December 2006

12 articles published in December 2006

  1. Use FxCop with ASP.NET 2.0

    · 1 min read

    The build process in ASP.NET 2.0 is very different than in ASP.NET 1.x, because it does not produce a dll file. That means that you cannot use FxCop because it can only work with dll and exe file types. However, there is...

  2. Remove nulls from a DataTable

    · 2 min read

    The individual cells in a DataTable can have a null value in the form of System.DbNull.Value. If the DataTable is created by querying a database through ADO.NET, you can write the SQL statement in a way eliminates nulls...

  3. List time zones in ASP.NET

    · 1 min read

    If you need a list of time zones for your user to pick from, you probably want a dropdown list. Then you just need a list of time zones to bind to the dropdown list. Unfortunately, the System.TimeZone class doesn’t...

  4. Maintain scroll position after postbacks

    · 1 min read

    To maintain the scroll position after postbacks is important for larger web pages in order to let the user know exactly what is going on. It is good usability and something you would expect in modern web applications. In...

  5. Let Windows place your temp files

    · 1 min read

    Whenever you need to write files to a temporary location, you can take advantage of Window’s own temporary file store location. It has write permissions by default, which often is a problem for especially hosted websites...

  6. A simple factory using Generics

    · 3 min read

    For about a week ago one of my readers asked me to simplify a piece of his code. The code was translating the different tags used by blog comments, such as [url][/url], [img][/img] etc. as we know from WordPress. It was...

  7. Get the HTTP status code from a URL

    · 2 min read

    Yesterday, I wrote about the Ping class for checking network availability on remote machines. Then I started thinking about checking the availability of web servers. Even if a remote server is available over the network...

  8. Using the Ping class

    · 1 min read

    The Ping class is new to .NET 2.0 and it let’s you ping remote addresses much the same way as the ping.exe command line tool does. It’s a great way to check the availability of different kinds of remote servers over the...

  9. Asynchronous pages in ASP.NET 2.0

    · 2 min read

    In ASP.NET 2.0 it is now possible to create asynchronous pages in a very simple and easy way. It gives you a whole new abstraction layer on top of the managed thread pool that let’s any webpage take advantage of...

  10. Remove HTML comments at runtime

    · 2 min read

    I’ve been playing a bit with regular expressions lately and have to find some useful tasks in order to practice the skill. So, today I wanted to make a little method that strips HTML comments from an ASP.NET webpage at...

  11. Compression and performance - GZip vs. Deflate

    · 1 min read

    After I wrote about a HTTP compression module in ASP.NET 2.0 one of my colleagues pointed out that the Deflate compression is faster than GZip. Because the HTTP compression module chooses GZip over Deflate if the browser...

  12. Why App_Code is better

    · 2 min read

    I remember when ASP.NET 2.0 beta 1 was released about 2 years ago and I eagerly tried it out. The first thing that struck me as strange was the new application folders like App_Code, App_Data, and App_Themes etc. They...