天天看點

HttpApplication事件執行順序

httpapplication事件執行順序

instances of the <b>httpapplication</b> class are created in the asp.net infrastructure, not by the user directly. one instance of the <b>httpapplication</b> class is used to process many requests in its lifetime; however, it can process only one request at a time. thus, member variables can be used to store per-request data.

an application executes events that are handled by modules or user code that is defined in the global.asax file in the following sequence:

beginrequest

authenticaterequest

postauthenticaterequest

authorizerequest

postauthorizerequest

resolverequestcache

postresolverequestcache

after the <b>postresolverequestcache</b> event and before the postmaprequesthandler event, an event handler (a page corresponding to the request url) is created.

<b>postmaprequesthandler</b>

acquirerequeststate

postacquirerequeststate

prerequesthandlerexecute

the event handler is executed.

postrequesthandlerexecute

releaserequeststate

postreleaserequeststate

after the <b>postreleaserequeststate</b> event, response filters, if any, filter the output.

updaterequestcache

postupdaterequestcache

endrequest