Error Handling

ASP provides you with several scripting objects that help with various tasks. One of them is the Err object, which helps you handle errors.

If you try to reload your page after you've already submitted it once, you get an error message. That message isn't very informative, however, and it's certainly not something we want our users to see. We can, however, handle this ourselves and avoid the error page.

You can handle the error with an On Error statement. What this means is that you tell ASP what to do if an error occurs. In VBScript, you don't have many error handling statements to choose from, but you can make do with On Error Resume Next. What this tells ASP is to keep going when it gets to an error. Add this to your page (see ...

Get Active Server Pages 3.0 from Scratch 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.