Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception Handling
Message
De
01/08/2005 15:37:46
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Exception Handling
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01037594
Message ID:
01037594
Vues:
96
All,

I am working on the exception handling portion of a web application. When an error occurrs I want the browser to be redirected to a page called errors.aspx. I have the error logging logic in the globabl.asax file and the customErrors defaultRedirect tag defined in my web.config file. When I run my applcation, on the server, and an error occurrs I recieve the built in .net Error Page. Below are the settings in the web.config and the logic in the Application_Error method. I just don't get it...
Web.Config 
<customErrors mode="On" defaultRedirect="Errors.aspx"/> 

Global.asax 
protected void Application_Error(Object sender, EventArgs e) 
 { 
  string err = ""; 
  Exception objErr = Server.GetLastError(); 
  err = "<b>Parathon Error Handler...</b><hr><br>" + 
      "<br><b>Error in: </b>" + Request.Url.ToString() + 
      "<br><b>Error Message: </b>" + objErr.Message.ToString() + 
      "<br><b>Target Site: </b>" + objErr.TargetSite.ToString() + 
      "<br><b>Stack Trace:</b><br>" + 
      objErr.StackTrace.ToString(); 
  } 
Thanks

Jim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform