Connecting Tech Pros Worldwide Forums | Help | Site Map

Does global.asa support Application_error event

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 8 '08
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_Error event.

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

Appreciate your help

DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 930
#2: Sep 9 '08

re: Does global.asa support Application_error event


Hi xavierselvaraj,

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

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

Expand|Select|Wrap|Line Numbers
  1. 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

Expand|Select|Wrap|Line Numbers
  1. If Err.Number <> 0 Then
  2.      'Handle your error here
  3.      Response.Write Err.Description
  4.      Error.Clear
  5. End If
Does this help?

Dr B
Reply