Open In App

ASP Server.GetLastError() Method (ASP 3.0)

The ASP Server.GetLastError() Method is used to return an ASP Error Object which defines the error condition that occurs. Generally, A website uses a Default file \iishelp\common\500-100.asp to encounter an error in the ASP file. Or we can also create our own file. This method is available only before the .asp file has sent any content to the client. 

Note: A 500;100 custom error will be generated if IIS encounters an error while processing either an ASP file or the application’s Global.asa file



Syntax:

Server.GetLastError()

Parameter Value: This method does not contain any parameter value. 



Return Values: This method does not return any value. 

The below example demonstrates the different types of errors. Basically, there are three types of errors: 

<!--#include f="header.inc" -->
<%
response.write("sometext")
%>
<%
dim i
for i=1 to 10
 ........
nxt
%>
<%
dim i,tot,j
i=0
tot=0
j=0

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

tot=tot/j
%>
Article Tags :