HTTPModule Transaction Order?

Does anyone know a site or page, or knows the order of the events of the HTTPApplication class to execute the HTTPModule event?

I found the MSDN documentation for all events, but did not display a list of process steps, and I was not able to find it.

+59
Jan 14 '09 at 0:13
source share
5 answers

Maybe it helps

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

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

  • Beginrequest
  • AuthenticateRequest
  • AuthorizeRequest
  • ResolveRequestCache
  • AcquireRequestState
  • PreRequestHandlerExecute
  • PostRequestHandlerExecute
  • ReleaseRequestState
  • UpdateRequestCache
  • Endrequest

The following events are available for synchronizing modules with each request transmission. The order of these events is not deterministic.

  • PreSendRequestHeaders
  • PreSendRequestContent
  • Mistake

See the article for full details.

+77
Jan 14 '09 at 0:32
source

MSDN Library Documentation:

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

  • Confirm the request, which checks the information sent by the browser and determines if it contains potentially malicious markup.
  • Match the URLs if any URLs were configured in the UrlMappingsSection section of the Web.config file.
  • Raise the BeginRequest event.
  • Raise the AuthenticateRequest event.
  • Raise the PostAuthenticateRequest event.
  • Raise the AuthorizeRequest event.
  • Raise the PostAuthorizeRequest event.
  • Raise the ResolveRequestCache event.
  • Raise the PostResolveRequestCache event.
  • [IIS 5.0 / 6.0] . Based on the file name extension of the requested resource (displayed in the application configuration file), select the class that implements IHttpHandler to process the request. If the request is for an object (page) obtained from the Page class, and the page must be compiled, ASP.NET compiles the page before instantiating it. [IIS 7.0] Raise the MapRequestHandler event. The appropriate handler is selected based on the file name extension of the requested resource. A handler can be a module with native code, such as IIS 7.0 StaticFileModule, or a managed code module, such as the PageHandlerFactory class (which processes .aspx files).
  • Raise the PostMapRequestHandler event.
  • Raise the AcquireRequestState event.
  • Raise the PostAcquireRequestState event.
  • Raise the PreRequestHandlerExecute event.
  • Call the ProcessRequest method (or the asynchronous version of IHttpAsyncHandler.BeginProcessRequest) of the corresponding IHttpHandler class to request. For example, if the request is for a page, the current instance of the page processes the request.
  • Raise the PostRequestHandlerExecute event.
  • Raise the ReleaseRequestState event.
  • Raise the PostReleaseRequestState event.
  • Filter the responses if the Filter property is defined.
  • Raise the UpdateRequestCache event.
  • Raise the PostUpdateRequestCache event.
  • [IIS 7.0] Raise the LogRequest event .
  • [IIS 7.0] Raise the PostLogRequest event .
  • Raise the EndRequest event.
  • Raise the PreSendRequestHeaders event.
  • Raise the PreSendRequestContent event.

Note. MapRequestHandler, LogRequest, and PostLogRequest events are supported only if the application runs in integrated mode in IIS 7.0 and the .NET Framework 3.0 or later.

+48
Jan 22 2018-12-01T00:
source

Beginrequest

Request started. If you need to do something at the beginning of the request (for example, show banner ads at the top of each page or some kind of initialization variable).

AuthenticateRequest

If you want to connect your own authentication scheme (for example, find the user in the database to verify the password or verify the header information in the HTTP request).

AuthorizeRequest

This event is used internally to implement authorization mechanisms (for example, to store access control lists (ACLs) in the database, and not in the file system).

ResolveRequestCache

This event determines whether the page can be served from the output cache. If you want to write your own caching module (for example, create a cache file, not a memory cache), then synchronize this event to determine whether to serve the page from the cache or whether a new page will be created.

AcquireRequestState

Session state is retrieved from the state store. If you want to create your own state management module, then synchronize this event to capture session state from your state store.

PreRequestHandlerExecute

This event occurs before the HTTP handler executes.

PostRequestHandlerExecute

This event occurs after the HTTP handler is executed.

ReleaseRequestState

Session state is stored in the state store. If you are creating a custom session state module, you must save your state in your repository.

UpdateRequestCache

This event writes output to the output cache.

Endrequest

Request completed.

+2
Jul 19 '16 at 4:34
source

Want to call the caching method in the PreSendRequestContent httpmodule event. The problem is that my application has added a web header and footer according to client requirements, and I could not cache these image contents, javascript and css. I am currently using the ReleaseRequestState httpmodule method.

0
Oct 03 '16 at 7:52
source

The accepted answer is out of date. Here is a list of events in the order they were raised:

  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 is created (which is the page corresponding to the request URL). When the server is running IIS 7.0 in integrated mode and at least the .NET Framework version 3.0, the MapRequestHandler event is raised. When the server is running IIS 7.0 in classic mode or an earlier version of IIS, this event cannot be processed.

  8. PostMapRequestHandler

  9. AcquireRequestState

  10. PostAcquireRequestState

  11. PreRequestHandlerExecute

  12. PostRequestHandlerExecute

  13. ReleaseRequestState

  14. PostReleaseRequestState

  15. UpdateRequestCache

  16. PostUpdateRequestCache

  17. Logrequest

  18. PostLogRequest

  19. Endrequest

Source

0
Mar 28 '19 at 21:58
source



All Articles