Creating Custom HTTP Error Pages

As discussed in Section 3.2.2 earlier, when an ASP error occurs on a web page, an HTTP 500;100 error is signaled. If you correctly set up an error-handling web page through the Internet Services Manager, IIS will automatically send the user to the specified error-handling web page via a Server.Transfer.

Of course there are several other types of HTTP errors besides 500;100. One of the most common errors is the HTTP 404 error, which results when a client requests a page not found on the web server. There is nothing as annoying or frustrating as the default HTTP 404 error page, which is shown in Figure 3.8.

The default 404 error page serves as a dead end, frustrating users

Figure 3-8. The default 404 error page serves as a dead end, frustrating users

The default 404 error page is ugly and serves as a dead end for your users. A much better approach is to provide your visitors with a custom 404 error page that apologizes for the page not being found and provides links to relevant sections on the site. Relevant sections might include a search page or a listing of popular resources on the site. The vast majority of large web sites realize the importance of custom 404 error pages. You can see some examples of real-world custom 404 error pages at the following URLs:

Custom 404 pages, unlike custom HTTP 500;100 error ...

Get Designing Active Server Pages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.