Tuesday, 7 December 2010

Disable custom errors for a page or group of pages asp.net

I had a situation today where I needed a single page on my site to return a proper error code to the client if an exception occurred. As this is a big customer facing site, we had already set up the customErrors tag in the web.config to give the users nice friendly messages.

I was surprised by the lack of information on how to do this when I Googled it. Its probably out there somewhere. But here is how I got around the problem. Simple when you think about it:

To turn off the custom error redirects I put the page in a folder in the site, then all you do is create a web.config file for that folder and set the custom errors mode to off.

Thats all folks...

Its about time....

I've finally got around to posting a blog! After spending ages reading others and getting the benefits of others hard work, it dawned on me that I should start giving back to the community. So here is a blog of my ramblings on Life, Programming, Sitecore, MVC and anything else I think of.

My only hope is that someone else can benefit this time round... Enjoy!