The Global.asx file is an that contains code for responding to level events raised by ASP.NET. This file is also called as ASP.NET application file. This file resides in the root directory of anapplication. If we are not defining this file in application, the ASP.NET page framework assumes that you have not defined any applicationa/Session events in the application.
Followign are the list of events handled in the global.asax file.
When an application starts. This event occurs only one time in an application’s life cycle. It occurs again when you restart the application. It’s the best place to count number of visitors.
This event occurs when application ends.
This event occurs whenever a new session starts. This is the best place to count user sessions for anapplication
Practical Usage: Setting user specific values, caching items based upon user context.
This event Opposite of the previous event.
This event occurs when an unhandled error or exception occurs in an application.
This event occurs every time when server makes a request. This event may occur multiple times in an applications life cycle.
This event occurs when an application closes