void Application_Start(object sender, EventArgs e) { // Code that runs on application startup if (!System.Diagnostics.EventLog.SourceExists("ERSite")) { System.Diagnostics.EventLog.CreateEventSource("ERSite", "ErrorLog"); } } void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs Exception ex = Server.GetLastError(); if (ex != null) { ErrorLog el = new ErrorLog(); el.Log(ex); Server.ClearError(); Response.Redirect("Error.aspx"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)