View Full Version : How to really turn off Errors?
imcrainjames
06-20-2010, 09:02 AM
I realize this is perhaps a simple question, but it has me stumped.
I am trying to prevent users from seeing detailed error messages, and while I have compilation debug=false in my web.config, I am still seeing error messages like the one I have attached.
Does anyone have any suggestions?
Thanks so much in advance.
James
CrystalCMS
06-20-2010, 02:28 PM
http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx
http://aspnetresources.com/articles/CustomErrorPages.aspx
HTH
imcrainjames
06-20-2010, 03:30 PM
Thanks for your help. I have actually implemented a Global.asax file, and used the Application_Error method (see attached).
Is it possible I still need to do something else?
CrystalCMS
06-20-2010, 10:01 PM
With your code as it is, the call to Server.ClearError() will never get processed because you have a call to Server.Transfer(""); first. The MSDN documentation for Server.Transfer advises:
"For the current request, terminates execution of the current page and starts execution of a new page by using the specified URL path of the page.".
I expect what you're seeing is an attempt to transfer to some error page however because ClearError never gets called, the default ASP.NET error page still gets displayed.
The second link I included in my 1st post explains the options in detail and it does include a global.asax example. In addition to a custom error page you might also want to investigate configuring health monitoring in the web.config for email notification of exceptions as they occur.
imcrainjames
06-21-2010, 07:13 AM
Excellent! Thanks so much, I will give it a try.
vBulletin® ©Jelsoft Enterprises Ltd.