Loading ...

Who is online?  0 guests and 1 members
home  »  blogs  »  Vivek Thakur

Communifire Blogs

Vivek Thakur : Most Recent postings

Vivek Thakur

Setup WCF Project in IIS 7

9/13/2010 by Vivek Thakur · 1 · 2404

How to setup IIS to work with WCF By default WCF is not configured in IIS, the .svc handlers are usually missing so you won't be able to run or test your WCF project after publishing it. Adding .svc file mappings is the first step, and can be done easily by following the below steps: 1. On the server (where you want the .svc mappings to be set in IIS) go to this folder: %windir%\Microsof...

Vivek Thakur

Problems with Indian MVP Community Emails

9/9/2010 by Vivek Thakur · 2 · 1415

Problems with Indian MVP Community Website and Email List For those who are not aware of the Microsoft MVP award , here is a brief introduction: MVPs are independent experts who are offered a close connection with people at Microsoft. To acknowledge MVPs’ leadership and provide a platform to help support their efforts, Microsoft often gives MVPs early access to Microsoft products, as wel...

Vivek Thakur

Cache vs Session state in ASP.NET: Replace Session with Cache

9/3/2010 by Vivek Thakur · 1 · 3554

Most web applications use both Session state as well as the Cache . We all know that ASP.NET Cache is more of a global storage cauldron for in-memory objects, where as the Session object is limited to each user. Now in a recent project, we faced a tricky issue with our internal Session usage. We were storing user roles inside the session, and wanted to refresh the role list when the user...

Vivek Thakur

301 Redirect from default.aspx to site root

9/1/2010 by Vivek Thakur · 0 · 4429

For efficient SEO, it is better that each URL should render unique data. So that means URLs having duplicate content, like http://mysite.com, http://www.mysite.com and http://www.mysite.com/default.aspx should be redirected to only a single URL having the same content. Scott Mitchell has a really nice article on this topic . But there is a catch! AFAIK, the code below (from the article) ...

Vivek Thakur

Do not buy MediaSoftPro component

9/1/2010 by Vivek Thakur · 7 · 4731

**UPDATE** We finally got some decent reply from the MediaSoftPro programmer, and he has promised us to resolve all our support issues. We are happy with the support now, and I hope they continue to give the same support to all of their other customers as well. Some companies try hard to market their software products but do not care about support at all. MediaSoftPro seems to be one of ...

Vivek Thakur

Forms Authentication timeout vs session state timeout

8/19/2010 by Vivek Thakur · 0 · 14852

Forms Authentication timeout vs session state timeout In ASP.NET web applications, when using Forms Authentication, we need to be aware of two different time outs when dealing with a logged in user relying on session data: 1. Forms Authentication ticket timeout 2. Session state time out When the user is trying to login, it is best to create a forms authentication ticket yourself after th...

Vivek Thakur

Install IIS on Windows 7

8/17/2010 by Vivek Thakur · 0 · 2508

How to install IIS on Windows 7 By default, Windows 7 Pro/Ultimate does not come with IIS 7 installed. Here is how you can add this extra feature: 1. Go to Start->Control Panel-> Programs and Features. 2. Select "Turn Windows features On or Off". 3. In the window that opens next, make sure to check IIS box, and click OK to install it. 4. After the installation, you can view your ho...

Vivek Thakur

Silverlight error open sharing violation file

8/13/2010 by Vivek Thakur · 0 · 3426

Recently while uploading a file to an online file management system (ASP.NET based), I got this weird error: Silverlight-Error-open-[IO.IO_SharingViolation_File] Debugging resource strings are unavailable . This sharing violation opening a file with OpenfileDialog error was coming whenever I was uploading a MS word document which was already opened for editing on my local system. Weird t...

Vivek Thakur

ASP.NET MVC vs Web forms

7/9/2010 by Vivek Thakur · 4 · 4132

With ASP.NET MVC 3 to be out soon, there are still many developers confused on whether to use MVC or the standard Web Forms UI while building their own custom ASP.NET web applications. I know this has been debated numerous times in the past but let me write on this topic in brief. It would be best to understand this excerpt from the man who created the ASP.NET platform , the great Scott ...

Vivek Thakur

Convert Int to Enum in C#

5/13/2010 by Vivek Thakur · 0 · 2890

Here is some quick code to convert an integer to an enum in C#: Assume we have an enum UserInfoDisplayField Method 1: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)Enum.ToObject(typeof(UserInfoDisplayFieldType),1)); Method 2: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)1; You can also check the existence of the enum value before conversion using the Enum.IsDefined field...

Vivek Thakur

Can I run ASP.NET 2.0 and 3.5 code on the same website?

4/27/2010 by Vivek Thakur · 1 · 2417

Run ASP.NET 2.0 and 3.5 applications on the same server Yes, you can run both together, infact the 3.5 applications use the 2.0 compiler. Why? Because version 3.5 is just a wrapper around 2.0 with some additional assemblies. But the newer 4.0 version is a completely new version, and will not be compatible with older versions. That is you cannot compile 3.5 or 2.0 code using 4.0 compiler,...

Vivek Thakur

Call C# code within ASPX page

4/26/2010 by Vivek Thakur · 0 · 7753

How to call C# code within ASPX page Many times we might need to call the C# or VB.NET code from within the ASPX page instead of using a code-behind file. Here is a quick code snippet to do the same: <%@ Page Language= "C#" %> <script runat= "server" > void Page_Load(object sender, EventArgs e) { MyLabelControl.Text = "time is " + DateTime.Now.ToString(); } //now a button cli...

Vivek Thakur

McAfee problem with Windows XP

4/22/2010 by Vivek Thakur · 0 · 1574

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Microsoft has been made aware of an issue with a McAfee DAT file update - released Wednesday, April 21, 2010 - that has been causing stability issues on Windows XP client systems. The symptom is caused by a false-positive detection on a core Windows file (svchost.exe). Once the file is quarantined by McAfee, the sy...

Vivek Thakur

How to check your website for SEO optimization

4/20/2010 by Vivek Thakur · 0 · 1463

Microsoft has a wonderful tool which can easily be installed on your server and gives you detailed reports on SEO-bility of your website, specifically: 1. you can run multiple reports to find out if your site has any major SEO issues. 2. not only does the toolkit identifies SEO issues, but also helps you fix them too. 3. it will index all reachable links on your website and provide detai...

Vivek Thakur

How to: Get domain name from Request object in ASP.NET

4/16/2010 by Vivek Thakur · 0 · 3538

Suppose you are running your ASP.NET application on a domain like http://www.mydomain.com, and you want to access this domain (www.mydomain.com) in your code. The below method can be used to get the host name: string host= HttpContext.Current.Request.Url.Host; One problem with this is that it will not get port number. For detailed explanation and other possible solutions, refer this link...

Vivek Thakur

FormsAuthentication Cookie Issue in IE8

4/3/2010 by Vivek Thakur · 0 · 6194

In one of our products, Communifire, we were dealing with a rather "silly" issue related to persistence of cookies in IE 8. We had created a new easy to implement Single Sign On (SSO) feature which lets users share authentication across parent domain and sub-domain (assuming CF is running on a sub-domain whereas users login via the parent website hosted on the TLD). We were creating a ne...

Vivek Thakur

Fiddler: No connection could be made because the target machine actively refused it

4/1/2010 by Vivek Thakur · 0 · 4433

While using Fiddler to examine HTTP traffic on your localhost, you may get this error: Fiddler: No connection could be made because the target machine actively refused it This happens because by default .NET bypasses local proxies while sending requests and Fiddler runs as a proxy. One way to catch local HTTP traffic is to change the URL in the browser by appending a "dot" to it (after t...

Vivek Thakur

Encoding byte array in C#

3/23/2010 by Vivek Thakur · 0 · 3733

I noticed a developer encoding an already RSA encrypted byte array to a string format, so that he can save it in database. He was using this code: byte[] message = Encoding.UTF8.GetBytes("string to be encrypted"); byte[] encrypted = rsaAlgo.PrivateEncryption(message); string save_in_db = Encoding.UTF8.GetString(encrypted); Then he simply wanted to decrypt save_in_db to its original value...

Vivek Thakur

Dictionary vs Hashtable vs ListDictionary vs HybridDictionary

7/22/2009 by Vivek Thakur · 0 · 11948

Hastables are deprecated now because with .NET 2.0 and above the Dictionary class is introduced which is much more efficient because it does not need to box or unbox data while adding/retrieiving items. ListDictionary should be used when the number of items are small (usually less than 10). Else if you are sure that your list will have more items, than use Dictionary. If you are not sure...

Vivek Thakur

Caching in ASP.NET: Velocity Distributed caching Framework

7/16/2009 by Vivek Thakur · 2 · 9068

Many beginner developers do not realize how effcient caching mechanisms can play a big role in increasing application performance. Most developers are accustomed to using the default In-Proc session state, or the Cache object to store the application related data. While such in-built caching mechanisms will work perfectly fine for most applications which do not need to scale to higher le...

Vivek Thakur

SQL server install error:One or more of the components being installed are already registered as 32 bit components in the target application.

7/15/2009 by Vivek Thakur · 2 · 7070

Recently I got this error while installing SQL Server 2005 64 bit on a machine where previously SQL Server 2005 32 bit was installed: Failed to install and configure assemblies C:\Program Files\Microsoft SQL Server\90\DTS\Tasks\Microsoft.SqlServer.MSMQTask.dll in the COM+ catalog. Error: -xxxxx Error message: Unknown error xxxx Error description: One or more of the components being insta...

Vivek Thakur

Abstract classes vs interfaces c#

7/9/2009 by Vivek Thakur · 0 · 5051

When should you use Abstract classes for implementing dynamic polymorphism? and when Interfaces are your best option? Most beginners tend to get confused between Abstract classes and Interfaces, so here is a quick primer: In Abstract classes you can use "abstract" keyword to mark methods which *must* to be implemented in derived classes, and use the "virtual" keyword to create some concr...

Vivek Thakur

You must first install one of the qualified Visual Studio editions

6/26/2009 by Vivek Thakur · 1 · 8985

Today I was installing MS Visio Enterprise Architect and got this error the moment the installer started to load: "You must first install one of the qualified Visual Studio editions". Considering that I have already installed Visual Studio 2008 Architectecture Edition, this error was very frustrating...after searching Google I noticed this post which mentioend that the Visio installer lo...

Vivek Thakur

The 7 Laws of IT Success in a Super-Slow Economy

5/4/2009 by Vivek Thakur · 1 · 2909

The seriousness of the world economy is starting to worry me. Not that it has affected my business one bit. But with billionaire investor George Soros telling the Times of London, "The chances of a depression are quite high," I realize there are lots of IT professionals who are not adequately prepared. How can they be? They're IT professionals, not sales and marketing professionals. And ...

Vivek Thakur

Row associated with the currency manager's position cannot be made invisible

4/1/2009 by Vivek Thakur · 1 · 31148

In your windows forms applicatons, if you want to hide/make inivisible a row of the DataGridView control at runtime, you would assume that this line will do the trick: for (int i = 0; i < dgridView.Rows.Count; i++) { if(someCondition) dgridView.Rows[i].Visible = false; } But the moment you do this, you will get this error: Row associated with the currency manager's position cannot be ...

Product Spotlight

ASP.NET Hosting Spotlight

Join CodeAsp.Net for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address:

 

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?