ASP GetLastError()
Method (ASP 3.0)
The GetLastError method returns an ASPError object that describes the reason for the error.
By default, the website uses the file \iishelp\common\500-100.asp to handle ASP errors. You can either use this file or create your own. If you wish to change the ASP file that handles 500;100 custom errors, use the IIS snap-in.
Note: A 500;100 custom error is generated if an error occurs while IIS is processing an ASP file or the Global.asa for an application.
Note: This method is only available before any content is sent to the browser by the ASP file.
Syntax
Examples
Example 1
In this example, an error occurs when IIS tries to reference a file, but the include statement does not use the file parameter:
Example 2
In this example, an error occurs when compiling the script due to the omission of the keyword "next":
Example 3
In this example, an error occurs when the script attempts to divide a number by 0: