Skip to content

Instantly share code, notes, and snippets.

protected void Application_Error(object sender, EventArgs e)
{
// get the last error
HttpException err = Server.GetLastError() as HttpException;
Server.ClearError();
// try to skip using any other custom error settings
Response.TrySkipIisCustomErrors = true;