Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I have a page that I usually get an eplanation as to an error (i.e. Syntax error) but now I only get "Page can not be displayed" Why would that be - anyway to force it to give me the details?

[conehead]
 
go to tools-> internet options -> advanced and then uncheck the box that says show friendly HTTP error messages...

-DNG
 
Debugging in classic ASP is always a challenge. What I've done in the past is use the following lines of code (be sure to have On Error Resume Next at the top of your ASP code)...

Code:
Response.Write Err.Description
Response.End

Try inserting those two lines of code in certain places in your ASP page, where you think an error could occur. I would suggest starting near the bottom of your ASP page, then running/opening the page. If the "Page Cannot be displayed" error shows, cut those two lines of code, then paste them up a bit higher in your page, and repeat until you get some meaningful error detail. This will help you to find where your error is occuring.

Another thing you could do is to place the following block of code after operations that may cause errors (again, On Error Resume Next should appear at the top of your ASP code)...

Code:
If Err.Number <> 0 Then
   Response.Write "ERROR: " & Err.Number & "<br>" & Err.Description & "<br>" & "Please contact IT for assistance." 
   Response.End
End If

This will give your users some "friendly" help with errors, rather than presenting the "Page cannot be displayed" page.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top