The Session in ASP.NET is a very simple way of storing user specific data for the duration of a single user session. I’ve many times added data to the Session that had an even shorter lifespan. That could be as a data...

For a website that supports multiple languages, it is important to tell the client what the selected language is. This is done in the <html> tag in the lang or xml:lang attribute and could look something like this for an...

For security reasons Microsoft doesn’t allow invisible columns in a GridView to be posted back like it does in the old DataGrid. That makes it impossible to store the ID of the row in an invisible column and then use it...

One of the nicest things about the new anonymous methods is how simple event handling has become. Here is an example of how we used to handle events. It demonstrates how to add an event handler to the btnSave’s Click...

Soon, I’m facing a new project where the need for up-to-date currency exchanges is crucial. This is not the first time I’ve done this, but I wanted to make a reusable, self-maintainable class so I don’t have to do it...

Lately, I’ve felt a bit alone in The World of what’s new, cool and wonderful. If you’ve been following the Web 2.0 blogs lately, you know what I’m talking about. I feel like everybody is talking a language I don’t...

The easiest way to make a redirection in ASP.NET is using Response.Redirect(url). What it actually does is, that it creates a response with the “302 (Object Moved)” status code and the target destination. It tells the...

We probably all know about the annoying captcha images that a lot of blogs uses for separating humans from machines (spam robots). I use a captcha image to avoid comment spam on this blog because I get a lot, but I...

Since ASP.NET 1.0 you had the ability to toggle the visibility of any HTML tag with the runat=”server” attribute. The only prerequisite is to add the runat=”server” and ID attributes, but that is not always possible or...

ASP.NET 2.0 introduced the CompilationMode attribute to let the developers decide how to compile individual pages, user controls and master pages. You can set the value to these three values: Always Auto Never This is...