Latest web development tutorials

ASP GetLastError method

Server Object Reference Complete Server Object Reference

ASPError GetLastError method returns an object that describes the cause of error.

By default, the site will use the file \ iishelp \ common \ 500-100.asp to process ASP errors. You can either use this document, or you can create your own file. If you want to change the process 500; 100 custom errors ASP file, use the IIS snap-in.

NOTE: If you encounter errors when handling Global.asa ASP file or application in IIS, it will generate a 500; 100 custom error.

NOTE: This method only send anything to the ASP file before the browser is available.

grammar

Server.GetLastError()

Examples

Example 1

In this example, when IIS tries to reference file, include the statement did not use the parameter file, an error occurs:

<!--#include f="header.inc" -->
<%
response.write("sometext")
%>

Example 2

In this case, when the script is compiled because the keyword "next" is missing, an error will occur:

<%
dim i
for i=1 to 10
........
nxt
%>

Example 3

In this case, since the script attempts to divide by 0 a number, an error will occur:

<%
dim i,tot,j
i=0
tot=0
j=0

for i=1 to 10
tot=tot+1
next

tot=tot/j
%>


Server Object Reference Complete Server Object Reference