Hi,
I'm trying to handle all my application exceptions inside the global.asax but from some reason it's not firing at all, i never tried to do it before so i guess i'm doing something wrong here...
here is the code inside the default.aspx page that throw the error:
and here is the code inside the global.asax:Code:protected void Page_Load(object sender, EventArgs e) { throw new Exception(); }
can someone please lead me to the right direction ?Code:void Application_Error(object sender, EventArgs e) { Exception objErr = Server.GetLastError().GetBaseException(); string err = "Error Caught in Application_Error event\n" + "Error in: " + Request.Url.ToString() + "\nError Message:" + objErr.Message.ToString() + "\nStack Trace:" + objErr.StackTrace.ToString(); EventLog.WriteEntry("Sample_WebApp", err, EventLogEntryType.Error); Server.ClearError(); Server.Transfer("~/About.aspx"); }


If you Like it 
Reply With Quote



