Web Code Blog

A web repository of coding tips and knowledge base articles

Archive for April, 2011

ASP.NET website not working with DNS Alias

Posted by Stefan Zvonar on April 5, 2011

This is a curious bit of information I have stumbled upon.

An ASP.NET Web Site will not persist session variables between requests when the host name has an underscore (“_”) in it. This is only apparent when using Internet Explorer.

Turns out that underscores are against the standard of naming servers. The particular server I was using decided they wanted to use a DNS Alias for all requests (in case of server name changes in the future). However, the alias itself had an underscore in it, which stopped page requests from working properly in the ASP.NET web site.

Here is a little summary from Microsoft:

SYMPTOMS

After you install security patch MS01-055 for Microsoft Internet Explorer 5.5 or 6.0, you may encounter the following problems:

* Session variables are lost.
* Session state is not maintained between requests.
* Cookies are not set on the client system.

Note These problems can also occur after you install a more recent patch that includes the fix that is provided in security patch MS01-055.

CAUSE
Security patch MS01-055 prevents servers with improper name syntax from setting…
Security patch MS01-055 prevents servers with improper name syntax from setting cookies names. Domains that use cookies must use only alphanumeric characters (“-” or “.”) in the domain name and the server name. Internet Explorer blocks cookies from a server if the server name contains other characters, such as an underscore character (“_”).

Because ASP session state and session variables rely on cookies to function, ASP cannot maintain session state between requests if cookies cannot be set on the client.

This issue can also be caused by an incorrect name syntax in a host header.

RESOLUTION
To work around this problem, use one of the following methods: Rename the domai…
To work around this problem, use one of the following methods:

* Rename the domain name and the server name, and use only alphanumeric characters.
* Browse to the server by using the Internet Protocol (IP) address rather than the domain/server name.

Note You may need to change the Microsoft Internet Information Server (IIS) configuration after you rename a server.

Click here to read the full Microsoft Support Article.

Hope this helps,

Stefan.

For more Web Code, ASP.NET, SQL Server and other development tips, please check back here at webcodeblog.com often.

Posted in .NET, ASP.NET, IIS | Leave a Comment »

Find out what service pack and edition your SQL Server installation is

Posted by Stefan Zvonar on April 4, 2011

Here is a quick little T-SQL script to run to find out some basic version, service pack and edition your SQL Server Instance is running:

SELECT SERVERPROPERTY('productversion') AS [Version], SERVERPROPERTY ('productlevel') AS [Service Pack], SERVERPROPERTY ('edition') AS [Edition]

The complete knowledge base article can be found here.

Hope this helps,

Stefan.

For more Web Code, ASP.NET, SQL Server and other development tips, please check back here at webcodeblog.com often.

Posted in SQL Server | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.