Forum Moderators: open
W3schools have an example on it's use here: [w3schools.com...]
However - I can't get it to work. If I run the example above 'as is' then the normal IIS error (HTTP 500.100 - Internal Server Error) file is opened.
If I add 'On error resume next' at the top? No improvement. Change the 'incorrect' line to cint("w") and then I get the screen as expected but all the error information is blank (the number is 0).
What am I doing wrong?
(Am using IIS5 on W2K)
<edit>removed request to be moved</edit>
What you have to do is put this code into an servererror.asp page (extension is important):
<html>
<body><%
dim objerr
set objerr = Server.GetLastError()'The variable objerr now contains the ASPError object
response.write("ASP Code=" & objerr.ASPCode)
response.write("<br />")
response.write("Number=" & objerr.Number)
response.write("<br />")
response.write("Source=" & objerr.Source)
response.write("<br />")
response.write("Filename=" & objerr.File)
response.write("<br />")
response.write("LineNumber=" & objerr.Line)
%></body>
</html>
Then create a separate .asp page that contains this:
<HTML>
<HEAD>
</HEAD>
<BODY>
<!--#include fil=inc.h -->
<%
dim I
for i=1 to 1
nxt
%>
<%
dim i,j
dim sum
sum=0
j=0for i=1 to 10
sum=sum+1
nextsum=sum/j
%>
</BODY>
</HTML>