Thursday, November 12, 2009

Web.Config

Explain Web.config Settings for exception management in ASP.NET
You should configure exception management settings within your application's Web.config file. e.g
< defaultredirect="http://hostname/error.aspx" mode="On">
< statuscode="500" redirect="/errorpages/servererror.aspx">
< statuscode="404" redirect="/errorpages/filenotfound.htm">
< /customErrors>


In the customErrors element, specify a default redirect page. There are three modes for the default redirect page:

On
Unhandled exceptions will redirect the user to the specified defaultredirect page. This is used mainly in production.

Off

Users will see the exception information and not be redirected to the defaultredirect page. This is used mainly in development.

RemoteOnly

Only users accessing the site on the local machine (using localhost) will see the exception information while all other users will be redirected to the defaultredirect page. This is used mainly for debugging.

In addition to the default redirect page, you can set specific pages for certain HTTP error codes. For example, you can specify that all 404 errors result in a certain error page, while all 500 errors result in another

No comments:

Post a Comment