Does global.asa support Application_error event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xavierselvaraj
    New Member
    • Sep 2008
    • 1

    Does global.asa support Application_error event

    I want to handle errors that occur in my classical asp pages in global.asa and redirect them to custom error page.

    This can be accomplished in global.asax via Application_Err or event.

    Is there an alterative in global.asa for the same.

    Appreciate your help
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi xavierselvaraj,

    Welcome to Bytes.com! I hope you find the site useful.

    There is no equivalent to the Application_Err or event in the Global.asa file. You can use vbscript error trapping on your pages to capture any likely errors by putting

    Code:
    On Error Resume Next
    at the top of your page. This will tell the interpreter to ignore any errors and continue processing the script. You can then use the following to handle any errors that have been thrown

    Code:
    If Err.Number <> 0 Then
         'Handle your error here
         Response.Write Err.Description
         Error.Clear
    End If
    Does this help?

    Dr B

    Comment

    Working...