April 2002
Beginner
672 pages
14h 43m
English
If you want to add application-wide error handling so that any unhandled error takes you to a page of your choosing (as opposed to the scary page shown in Figure 12.2), you can make a simple modification in the Web.Config file to add your settings. Open Web.Config and modify the customErrors element, which normally looks like the following:
<customErrors mode="RemoteOnly" />
You can change it so any error that occurs will redirect to a specific page using the defaultRedirect attribute:
<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx" />
You must create the page you're redirecting users to; that is, ErrorPage.aspx must be a page you've created in your application. To test this out in the sample application, ...
Read now
Unlock full access