This article is a mirror article of machine translation, please click here to jump to the original article.

View: 41476|Reply: 2

[ASP.NET] ASP.NET MVC HttpApplication execution order

[Copy link]
Posted on 2021-6-10 16:38:27 | | |
Instances of the class (from which Global inherits) are created in the ASP.NET infrastructure and not directly by the user. An instance of the HttpApplication class is used to handle multiple requests during its lifetime, but it can only handle one request at a time. This allows member variables to be used to store data for each request.

The application executes events handled by the module or user code defined in the global.asax file in the following order:

1、BeginRequest
(Occurs as the first event in the HTTP execution pipeline chain when ASP.NET responds to a request)

2、AuthenticateRequest
(Occurs when the security module has established a user identity.) Note: The AuthenticateRequest event signals that the configured authentication mechanism has authenticated the current request. Scheduling an AuthenticateRequest event ensures that the request is authenticated before processing the attached module or event handler. )

3、PostAuthenticateRequest
(Note: This event is new in .NET Framework version 2.0.) Occurs when the security module has established a user identity. The PostAuthenticateRequest event is raised after the AuthenticateRequest event occurs. The ability to schedule a PostAuthenticateRequest event can access any data processed by the PostAuthenticateRequest. )

4、AuthorizeRequest
(Occurs when the security module has verified user authorization.) The AuthorizeRequest event signals that ASP.NET has authorized the current request. Scheduling an AuthorizeRequest event ensures that requests are authenticated and authorized before processing additional modules or event handlers. )

5、PostAuthorizeRequest
(New events in .NET 2.0.) Occurs when the currently requested user is authorized. The PostAuthorizeRequest event signals that ASP.NET has authorized the current request. Booking a PostAuthorizeRequest event ensures that requests are authenticated and authorized before processing additional modules or handlers. )

6、ResolveRequestCache
(Occurs when ASP.NET completes an authorization event to have the cache module serve the request from the cache, skipping the execution of an event handler (such as a page or XML Web ervices.) )

7、PostResolveRequestCache
(Occurs when ASP.NET skips the execution of the current event handler and allows the cache module to satisfy requests from the cache.) PostResolveRequestCache event, PostMapRequestHandler
Create an event handler (corresponding to the page of the request URL) before the event.

8、PostMapRequestHandler
Occurs when ASP.NET has mapped the current request to the appropriate event handler

9、AcquireRequestState
Occurs when ASP.NET gets the current state associated with the current request, such as the session state

10、PostAcquireRequestState
Occurs when you have obtained a request status associated with the current request, such as a session state

11、PreRequestHandlerExecute
It happens just before ASP.NET starts executing an event handler (for example, a page or an XML Web service).

12、PostRequestHandlerExecute
Occurs when a ASP.NET event handler (for example, a page or an XML Web service) finishes executing

13、ReleaseRequestState
Occurs after ASP.NET has executed all request event handlers. This event will cause the status module to save the current state data.

14、PostReleaseRequestState
Occurs when ASP.NET has completed the execution of all request event handlers and the request state data has been stored.

15、UpdateRequestCache
This occurs when ASP.NET finishes executing the event handler so that the cache module store will be used to serve the response from the cache to subsequent requests.

16、PostUpdateRequestCache
This event occurs after ASP.NET completes updating the cache module and stores the response to serve subsequent requests from the cache.

17、EndRequest
Occurs as the last event in the HTTP execution pipeline chain when ASP.NET responds to a request.

The code is as follows:





Previous:Nginx implements TCP (FTP) proxy forwarding
Next:Missing or insecure vulnerabilities in the "Content-Security-Policy" header
Posted on 2021-7-8 10:38:07 |
Learn some learning
Posted on 2021-9-22 20:57:58 |
Learn to learn。。。。。。
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com