What are Major Events in Global ASAX file?
Global ASAX file:
The Global.ASAX file, which is derived from the HTTP Application class, maintains a pool of HTTP Application objects and assigns them to applications as needed. The Global. Sax file contains the following events:
Major Events in Global.ASAX file:
Application_Init: Fired when an application initializes or is first called. It is invoked for all HTTP Application object instances.
Application Disposed: Fired just before an application is destroyed. This is the ideal location for cleaning up previously used resources.
Application Error: Fired when an unhandled exception is encountered within the application.
Application Start: Fired when the first instance of the HTTP Application class is created. It allows you to create objects that are accessible by all HTTP Application instances.
Application End: Fired when the last instance of an HTTP Application class is destroyed. It is fired only once during an application’s lifetime.
Application_BeginRequest: Fired when an application request is received. It is the first event fired for a request, which is often a page request (URL) that a user enters.
Application_EndRequest: The last event fired for an application request.
Application_PreRequestHandlerExecute: Fired before the ASP.NET page framework begins executing an event handler like a page or Web service.
Application_PostRequestHandlerExecute: Fired when the ASP.NET page framework has finished executing an event handler.
Applcation_PreSendRequestHeaders: Fired before the ASP.NET page framework sends HTTP headers to a requesting client (browser).
Application_PreSendContent: Fired before the ASP.NET page framework send content to a requesting client (browser).
Application_AcquireRequestState: Fired when the ASP.NET page the framework gets the current state (Session state) related to the current request.
Application_ReleaseRequestState: Fired when the ASP.NET page framework completes execution of all event handlers. This results in all state modules saving their current state data.
Application_ResolveRequestCache: Fired when the ASP.NET page framework completes an authorization request. It allows caching modules to serve the request from the cache, thus bypassing handler execution.
Application_UpdateRequestCache: Fired when the ASP.NET page framework completes handler execution to allow caching modules to store responses to be used to handle subsequent requests.