Initial import
This commit is contained in:
parent
0c865416ca
commit
04804b89a9
279 changed files with 12945 additions and 0 deletions
91
web/errors/CustomErrorPages/CustomErrors2/Global.asax.cs
Normal file
91
web/errors/CustomErrorPages/CustomErrors2/Global.asax.cs
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Web;
|
||||
using System.Web.SessionState;
|
||||
|
||||
namespace CustomErrors2
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Global.
|
||||
/// </summary>
|
||||
public class Global : System.Web.HttpApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
public Global()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected void Application_Start(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Session_Start(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_BeginRequest(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_EndRequest(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_Error(Object sender, EventArgs e)
|
||||
{
|
||||
// At this point we have information about the error
|
||||
HttpContext ctx = HttpContext.Current;
|
||||
|
||||
Exception exception = ctx.Server.GetLastError ();
|
||||
|
||||
string errorInfo = "<br>Offending URL: " + ctx.Request.Url.ToString () +
|
||||
"<br>Source: " + exception.Source +
|
||||
"<br>Message: " + exception.Message +
|
||||
"<br>Stack trace: " + exception.StackTrace;
|
||||
|
||||
ctx.Response.Write (errorInfo);
|
||||
|
||||
// --------------------------------------------------
|
||||
// To let the page finish running we clear the error
|
||||
// --------------------------------------------------
|
||||
ctx.Server.ClearError ();
|
||||
}
|
||||
|
||||
protected void Session_End(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_End(Object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Web Form Designer generated code
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue