Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old September 8th, 2008, 05:57 PM
Newbie
 
Join Date: Sep 2008
Posts: 1
Default 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_Error event.

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

Appreciate your help
Reply
  #2  
Old September 9th, 2008, 08:01 AM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 926
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles