Introduction to ASP.NET and Web Forms

來源:互聯網
上載者:User

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
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.