The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Global error handling

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Michael Mello

Posts: 100
Nickname: knarf
Registered: May, 2004

Michael Mello is .NET Web Developer
Global error handling Posted: May 1, 2004 8:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Michael Mello.
Original Post: Global error handling
Feed Title: melloblog
Feed URL: http://www.thauvin.net/errorpage.htm?aspxerrorpath=/Default.aspx
Feed Description: .NET and Everything After.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Michael Mello
Latest Posts From melloblog

Advertisement
Creating global error handling is a good idea that allows your site to catch unexpected errors, which may occur at the application level.  In order to accomplish this task, you will need to place code in the Application_Error method of the Global.asax.cs file.


//Global.asax.cs

protected void Application_Error(Object sender, EventArgs e)
{
  //Error has occurred - redirect the user to our error page.
  Response.Redirect("Error.aspx");

}



This is a very simple example that will redirect a user to our Error.aspx web page, if any unhandled exception occurs.  Although we're simply doing a redirect here, we could have utilized this method to notify the web administrator by email, with the details of the error, page, time, etc, etc.

If you're looking for a way to email through your web application, then be sure to check out my blog on how to create an Automated Email System.

Read: Global error handling

Topic: Lordy, lordy, BASIC's forty! Previous Topic   Next Topic Topic: [Cool Tip] Speed up Outlook email switching

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use