Hi,
All the events like Session_Start or Session_End or Application_Start or Application_End etc will be present in Global.asax
You can use Global.asax file when you want executed any specific code that need to be executed when ever new session starts or ends or when application starts etc.
Global.aspx (Global Application class) contains the following events:
protected void Application_Start(object sender, EventArgs e)
{
//Executes when application starts and this event will be executed only once.
}
protected void Session_Start(object sender, EventArgs e)
{
//Executes when a new session starts
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
//Use when you want do something when application begins
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
//Use when you want to athenticate the request
}
protected void Application_Error(object sender, EventArgs e)
{
//Use when you want to log errors when any unhandled exectiption occurs
}
protected void Session_End(object sender, EventArgs e)
{
//Executes when session ends
}
protected void Application_End(object sender, EventArgs e)
{
//Executes when application ends, usually calls this while doing maintainance
}
You can use above events, based on your requirements.