码迷,mamicode.com
首页 > Web开发 > 详细

HTTPModule Event Execution Order?

时间:2020-07-18 00:56:58      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:eterm   cell   instance   static   form   ping   support   def   handler   

HTTPModule Event Execution Order?

Does anyone know of a site or page, or know the order of execution for the events of the HTTPApplication class for HTTPModule event execution?

I found the MSDN Documentation for all of the events, but it doesn‘t show a list of process steps and I haven‘t been able to find one.

 

回答1

Maybe this helps

http://support.microsoft.com/kb/307985/en-us/

An HttpApplication class provides a number of events with which modules can synchronize. The following events are available for modules to synchronize with on each request. These events are listed in sequential order:

  1. BeginRequest
  2. AuthenticateRequest
  3. AuthorizeRequest
  4. ResolveRequestCache
  5. AcquireRequestState
  6. PreRequestHandlerExecute
  7. PostRequestHandlerExecute
  8. ReleaseRequestState
  9. UpdateRequestCache
  10. EndRequest

The following events are available for modules to synchronize with for each request transmission. The order of these events is non-deterministic.

  • PreSendRequestHeaders
  • PreSendRequestContent
  • Error

See the article for full info.

 

回答2

MSDN Library documentation:

Here are the events (in bold) and other steps in the request pipeline for ASP.NET 4.0:

  1. Validate the request, which examines the information sent by the browser and determines whether it contains potentially malicious markup.
  2. Perform URL mapping, if any URLs have been configured in the UrlMappingsSection section of the Web.config file.
  3. Raise the BeginRequest event.
  4. Raise the AuthenticateRequest event.
  5. Raise the PostAuthenticateRequest event.
  6. Raise the AuthorizeRequest event.
  7. Raise the PostAuthorizeRequest event.
  8. Raise the ResolveRequestCache event.
  9. Raise the PostResolveRequestCache event.
  10. [IIS 5.0/6.0] Based on the file name extension of the requested resource (mapped in the application‘s configuration file), select a class that implements IHttpHandler to process the request. If the request is for an object (page) derived from the Page class and the page needs to be compiled, ASP.NET compiles the page before creating an instance of it. [IIS 7.0] Raise the MapRequestHandler event. An appropriate handler is selected based on the file name extension of the requested resource. The handler can be a native-code module such as the IIS 7.0 StaticFileModule or a managed-code module such as the PageHandlerFactory class (which handles .aspx files).
  11. Raise the PostMapRequestHandler event.
  12. Raise the AcquireRequestState event.
  13. Raise the PostAcquireRequestState event.
  14. Raise the PreRequestHandlerExecute event.
  15. Call the ProcessRequest method (or the asynchronous version IHttpAsyncHandler.BeginProcessRequest) of the appropriate IHttpHandler class for the request. For example, if the request is for a page, the current page instance handles the request.
  16. Raise the PostRequestHandlerExecute event.
  17. Raise the ReleaseRequestState event.
  18. Raise the PostReleaseRequestState event.
  19. Perform response filtering if the Filter property is defined.
  20. Raise the UpdateRequestCache event.
  21. Raise the PostUpdateRequestCache event.
  22. [IIS 7.0] Raise the LogRequest event.
  23. [IIS 7.0] Raise the PostLogRequest event.
  24. Raise the EndRequest event.
  25. Raise the PreSendRequestHeaders event.
  26. Raise the PreSendRequestContent event.

Note: The MapRequestHandler, LogRequest, and PostLogRequest events are supported only if the application is running in Integrated mode in IIS 7.0 and with the .NET Framework 3.0 or later.

 

HTTPModule Event Execution Order?

标签:eterm   cell   instance   static   form   ping   support   def   handler   

原文地址:https://www.cnblogs.com/chucklu/p/13333834.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!