Detect when a session has ended ASP.NET
A problem that I have had in the past is trying to find out when a session has expired within ASP.NET and how to deal with the expired session. One solution is to add the following code into the Page_Init event. You can add this event into a class that inherits the Page class so [...]
Could not load file or assembly ‘NameOfAssemblyGoesHere’
Encounted the following error: Could not load file or assembly ‘NameOfAssemblyGoesHere’ or one of its dependencies. An attempt was made to load a program with an incorrect format. The problem happened when deploying a web application to a 64bit server where all the required DLL’s where marked as running only on a 32bit system. You [...]
Change username in ASP.NET Membership Provider
Found a great article here about the process of changing the username with the ASP.NET Membership Provider. Here is a summary of the process that I found best useful which is one of the comments: 1. Make sure New UserName is Unique 2. Update the aspnet_Users table directly 3. Execute to following code to change [...]
DateTime.ToString()
Here is a link that is useful as a reference for DateTime.ToString patterns References: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm
Using the HttpWebRequest class
In this particular scenario I had to initiate a request from another website in code and track its response to be modified and rendered back to the user. I had a series of LinkButton html controls on the web form that consume one event. <asp:LinkButton id=”link1” runat=”server” onClick=”genericEvent”></asp:LinkButton> When the user clicks on a particular [...]
Using ASP.NET MVC on IIS6 or below
When you are building a web applicatio using the ASP.NET MVC framework on IIS7, it URL routing works smoothly and without any dramas. But when it comes to IIS6 you have to make a comprimse especially if you are developing web apps within a shared hosting envoirnment. I found the easist way is to change [...]
W3C Validation and ASP.NET ViewState
The problem I came across a very interesting point about validating XHTML pages using W3C XHTML Strict and ViewState. By default ASP.NET ViewState adds a number of hidden fields to handle the postback of ASP.NET pages, control state and control event validation. See example below. <input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”” /> When validating web pages [...]
Creating a generic list of anonymous types
Scenerio I have a simple HTML form on a ASP.NET Web page. This form is to post a number of values including several elements that are compulsory to perform several actions on the server. As we know, when we post values to ASP.NET these are available for Request.Form. All we know is the key and [...]
ASP.NET Server Controls using XML/XSL
Scenario I have developed a framework that allows me to have multiple XSL templates transformed onto an ASP.NET web form. This works well without any ASP.Net server controls on the XSL templates. The question I wanted answered is how to have ASP.NET server controls on a XSL template so that I can dynamically create controls [...]


