1.Adding this code to the Default.asax file: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}
2.Adding this code to the Global.asax file: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}
3.Adding this code to the ErrorPage.aspx file: void Page_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log Server.ClearError();}
4.Adding this code to the master page: void Application_Error(object sender, EventArgs e){Exception exc = Server.GetLastError();//Write Exception details to event log}