September 2008 Entries

Creating your own Unhandled Error Logging Module

I'm a big fan of the ELMAH project which I utilise in my personal website GamerLobby.net This is great for plugging into an existing website to catch unhandled exceptions, but not ideal when you want to log to an existing infrastructure. So I set of on the task to create my own custom unhandled error logging module, and this is what I came up with.

HttpModules - Why using HttpApplication is a bad idea

I was using Darksider's page optimisation module to clean up and optimise my sites HTML gamerlobby.net This was working like an absolute champ up until the night I decided to go live. Leaving ELMAH for the last minute as it was so darn easy to implement, I started to struggle to get it to start logging. It made no sense. Database created, Connection String present and correct, modules and handlers referenced. WHAT CAN IT BE.

Organising that jungle of cables you're hoarding

Several times I've seen these shows on TV about hoarders. That seem like really sad people who don't know when to get rid of something, and I pity them.

So recently I moved house, and to my shocking surprise realised that I was in fact a hoarder to some extent. Darn it!! I am one of those people. Well, I guess we are all to some extent. This brings me to the post.

ServerVariables empty unless Debug

Just had a really strange issue where I'm trying to log some ServerVariables when an error occurs. The bug was when I ran the code without debugging, no ServerVariables were being logged. If I went into Debug, and hovered my mouse over the ServerVariables variable, it had all the information I was looking for. After that, it logged everything fine.

Disable button on post back

Often post backs can take some time, and it appears to a user as if the browser is not responding causing the user to click the button multiple times. In ASP.NET it is most simple to disable a button on click, and still post back to the page. Here is how we can do this with an ASP.NET button.

«September»
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011