ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Trapping HTTP 500.100 - Internal Server Error

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
87 active users
797 visitors today
1212 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Using Internet Information Server (IIS), you can trap both compilation and run-time errors that occur in your ASP page.

Here's an example file that contains errors - we'll run this page in a minute and see how the errors are trapped.

Test500100.asp

<%@ Language=JavaScript %>

<%
   // call a function that doesn't exist...
   Hello ( );

   // or divide by zero
   var a = b / 0;

   // or don't finish a statement
   Unfinished (
%>

Any of the errors in this file would cause a HTTP 500.100 error, which in turn would send a generic message back to the browser - probably the infamous "This page cannot be displayed".

IIS allows you to override this default behaviour, and specify a file that will be called when an error occurs. You can specify an HTML page or an ASP page. I use an ASP page, so the site will send me an email whenever an error occurs. Don't rely on your users telling you that the site crashed!

Part 2: The Handle500100.asp file...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...