ASP On Error Redirect
In ASP JavaScript I am trying to form a statement (possibly an if statem开发者_StackOverflow社区ent) that will catch any error's that occur on any ASP page and when there is one it will redirect the page to an error page that will display the previous pages title and error number.
How can I identify the error and redirect to a new ASP page with the two pieces of information?
Something like the following should work fine:
If Err.Number <> 0 Then
Response.Redirect("/path/to/page.asp?errnum=" & Err.Number & "&pagetitle=your%20page%20title"
End If
On your destination error page simply read the values from the querystring e.g. Request.QueryString("errnum")
Try this
Hope this helps and solves your issue.
<%If Err.Number <> 0 Then Response.Redirect("/my/Error Page/ErrorPage.asp?errnum=" & Err.Number & "&pagetitle=your%20page%20title", false) End If %>
精彩评论