Q.)How do I configure custom error pages for my ASP.Net application? A.) Modify your web.config file to set up custom error handling for your ASP.Net application. As an example, if you want to redirect all 404 errors to 404.aspx, 500 errors to 500.aspx, and all other errors to error.htm, you would update the customErrors element in your web.config as follows:
<customErrors mode="On" defaultRedirect="error.htm"> <error statusCode="500" redirect="error500.aspx"/> <error statusCode="404" redirect="error404.aspx"/> </customErrors>
CustomErrors is set to Off by default on all our web servers. If you do not customize the custom error element in the web.config file, the default ASP.net error (conatining debug data) will be displayed. | | | Information | | FAQ ID: 66 | | Created on: May 25, 2005 | | Views: 3702 |
|
|
|