Thursday, July 30, 2009

HttpModule Execution Sequence

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

1. BeginRequest
2. AuthenticateRequest
3. PostAuthenticateRequest
4. AuthorizeRequest
5. PostAuthorizeRequest
6. ResolveRequestCache
7. PostResolveRequestCache

After the PostResolveRequestCache event and before the PostMapRequestHandler event, an event handler (a page corresponding to the request URL) is created.

8. PostMapRequestHandler
9. AcquireRequestState
10. PostAcquireRequestState
11. PreRequestHandlerExecute

The event handler is executed.

12. PotRequestHandlerExecute
13. ReleaseRequestState
14. PostReleaseRequestState

After the PostReleaseRequestState event, response filters, if any, filter the output.

15. UpdateRequestCache
16. PostUpdateRequestCache
17. EndRequest

No comments: