Customize Global.asax for Application_Error handler

r00ty0u

New Member
I have a \[code\]Global.asax\[/code\] file that has logging code inside \[code\]Application_Error\[/code\] handler. I need to customize it in such a way that the Application_Error handler is not reached if the exception is happened while looking for a \[code\]favicon.ico\[/code\] file. How can we bypass the hitting of Application_Error when the exception is for favicon.ico?\[quote\] Exception: File does not exist.\[/quote\]\[code\]Url: http://localhost:14658/favicon.ico \[/code\]Note: There is no favicon.ico reference in the solutionNote: I am using internet explorer as the browserCODE\[code\] protected void Application_Error(object sender, EventArgs e) { Exception occuredException = Server.GetLastError().GetBaseException(); string connectionString = ConfigurationManager.ConnectionStrings[UIConstants.PayrollSQLConnection].ConnectionString; ExceptionBL exceptionBL = new ExceptionBL(connectionString); string location = Request.Url.ToString(); exceptionBL.SubmitException(occuredException.Message, location); }\[/code\]Reference:[*]Application_Error getting called numerous times
 
Back
Top