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...

No comments:

Post a Comment