Tuesday, March 25, 2008

Visual Studio 2008 HotFix and VB HotFix

A HotFix for VS2088 was released early in February that addresses several issues reported with Web Applications. A list of the fixed bugs can be seen on ScottGu's Blog. You can download the hot fix here.

Also, 2 days ago, the Visual Basic team released a HotFix that solves some performance issues in VS2008. Download it here


Monday, March 24, 2008

App_Offline Goodness

ASP.NET 2.0 comes with this built-in feature to easily bring down an Web Application, make changes to it and reload the application back again.

It's as easy as uploading an App_Offline.htm file in the root of your Web Application directory and you are done. Include any "under construction" or "maintenance" messages in the App_Offline.htm file that you want to display to your end users.

Once you are done, simply delete the file and ASP.NET will reload the application and everything is back to normal. For detailed info check ScottGu's blog.

Friday, March 21, 2008

Server.HtmlEncode vs HttpUtility.HtmlEncode

Have you ever wonder why there is an Html Encoding function (and other similar functions) in 3 different objects and namespaces?
The most common one is Server.HtmlEncode or System.Web.HttpContext.Current.Server.HtmlEncode.  The Server Object is an instance of the System.Web.HttpServerUtility Class and it is readily accessible through any .aspx page since they inherit from the Page object which in turn has a Server Object instance.  The second HtmlEncode function lives under System.Web.HttpUtility.  This class is basically a static version of the Server class which means that you could call the HtmlEncode function from a static function or call from another class that does not have an instance of the HttpServerUtility class. Finally,  The third HtmlEncode function is located in the Microsoft's AntiCross-Site Scripting Library. In contrast with the Server.HtmlEncode and HttpUtility.HtmlEncode functions, the later function takes a more aggressive approach by using a white-list filtering instead of a black-list.
Hope this helps.