Introduction to ASP.NET and Web Forms

http://msdn.microsoft.com/en-us/library/ms973868

Global.asax

The Global.asax file is similar to the Global.asa file in ASP, albeit that there are many more events available in ASP.NET. Also, Global.asax is compiled instead of interpreted as it is in ASP. You still have event procedures that fire within the Global.asax file when certain events happen on your Web site. In the following list, you will find the event procedures that are available to you within the Global.asax file.

Table 4. Event procedures available within Global.asax

Event Procedure Description
Application_Start Fires when the first user hits your Web site
Application_End Fires when the last user in the site's session times out
Application_Error Fires when an unhandled error occurs in the application
Session_Start Fires when any new user hits your Web site
Session_End Fires when a user's session times out or ends
Application_AcquireRequestState Fires when ASP.NET acquires the current state (for example, session state) associated with the current request
Application_AuthenticateRequest Fires when a security module establishes the identity of the user
Application_AuthorizeRequest Fires when a security module verifies user authorization
Application_BeginRequest Fires when ASP.NET starts to process the request, before other per-request events
Application_Disposed Fires when ASP.NET completes the chain of execution when responding to a request
Application_EndRequest Fires as the last event during the processing of the request, after other pre-request events
Application_PostRequestHandlerExecute Fires right after the ASP.NET handler (page, XML Web service) finishes execution
Application_PreRequestHandlerExecute Fires just before ASP.NET begins executing a handler such as a page or XML Web service
Application_PreSendRequestContent Fires just before ASP.NET sends content to the client
Application_PreSendRequestHeaders Fires just before ASP.NET sends HTTP headers to the client
Application_ReleaseRequestState Fires after ASP.NET finishes executing all request handlers. This event causes state modules to save the current state data
Application_ResolveRequestCache Fires after ASP.NET completes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the handler (the page or Web service, for example).
Application_UpdateRequestCache Fires after ASP.NET finishes executing a handler in order to let caching modules store responses that will be used to serve subsequent requests from the cache

你可能感兴趣的:(asp.net)