Interview Question
Qus: What are the event handlers that we have for the Global.asax file?
Answers (1)
The following are some of the important events in the Global.asax file:
Application_Init : The Application_Init event is fired when an application initializes the first time.
Application_Start : The Application_Start event is fired the first time when an application starts.
Application_AuthorizeRequest: Fired when the security module has verified that a user can access resources.
Application_ResolveRequestCache : Fired on successful completion of an authorization request.
Application_Disposed: Fired just before an application is destroyed. This is the ideal location for cleaning up previously used resources.
Session_Start : The Session_Start event is fired the first time when a user’s session is started. This typically contains for session initialization logic code.
Application_BeginRequest: The Application_BeginRequest event is fired each time a new request comes in
Application_EndRequest : The last event fired for an application request.
Application_AuthenticateRequest : The Application_AuthenticateRequest event indicates that a request is ready to be authenticated. If you are using Forms Authentication, this event can be used to check for the user's roles and rights.
Application_Error : The Application_Error event is fired when an unhandled error occurs within the application.
Session_End : The Session_End Event is fired whenever a single user Session ends or times out.
Application_End : The Application_End event is last event of its kind that is fired when the application ends or times out. It typically contains application cleanup logic.