Introduction
The Global.asax file is an optional file used to declare and handle application
and session-level events and objects for an ASP.NET web site running on an IIS
Web Server. The file contains ASP.NET program code, and is the .NET counterpart
of the Global.asa file used for ASP. The Global.asax file resides in the IIS
virtual root of an ASP.NET application.
Default Structure of Global.asax
using System;
using
System.Web;
using
System.Web.Security;
using
System.Web.SessionState;
namespace
TestApplication
{
public class
Global : System.Web.HttpApplication
{
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_AuthenticateRequest(object
sender, EventArgs e)
{
}
protected void
Application_Error(object sender,
EventArgs e)
{
}
protected void
Session_End(object sender,
EventArgs e)
{
}
protected void
Application_End(object sender,
EventArgs e)
{
}
protected
void Application_PreRequestHandlerExecute(object
sender, EventArgs e)
{
}
private bool
IsUrlInModule(List<string>
modules, string url)
{
}
}
}
global.asax events
• HttpApplication Events

Join the conversation! Your thoughts help the community grow.