Asp. The sequence of events executed in the ProcessRequest method in HttpApplication. Net
1.BeginRequest Start processing Requests
2.AuthenticateRequest Authorization authentication request, obtaining user authorization information
3.PostAuthenticateRequest Get success
4.AunthorizeRequest authorization, general to check whether the user is granted permission
5.PostAuthorizeRequest Get Authorization
6.ResolveRequestCache Gets the page cache result (if none is executed)
7.PostResolveRequestCache Cache has been obtained
8.PostMapRequestHandler Creating a Page object
9.AcquireRequestState get session--first to determine whether the current Page object implements the IRequiresSessionState interface, if implemented, from the browser sent from the request packet header to obtain SessionID, and to the server's In the session pool, the corresponding session object is obtained, and the last assignment is given to the session property of HttpContext.
10.PostAcquireRequestState Get session
11.PreRequestHandlerExecute prepare the Page object for execution
X executes the ProcessRequest method (1.ashx,1.aspx) of the Page object and, if the request is 1.aspx, runs the page life cycle
12.PostRequestHandlerExecute finished executing the Page object
13.ReleaseRequestState Release Request Status
14.PostReleaseRequestState released request status
15.UpdateReuqestCache Update Cache
16.PostUpdateRequestCache Cache has been updated
17.LogRequest Log Records
18.PostLogRequest completed Log
19.EndRequest Complete
You can run the test again in Global.asax with Application_ as the prefix + event name! For example:
public class MvcApplication:System.Web.HttpApplication {protected void Application_Start () { Arearegistration.registerallareas (); Webapiconfig.register (globalconfiguration.configuration); Filterconfig.registerglobalfilters (globalfilters.filters); Routeconfig.registerroutes (routetable.routes); Bundleconfig.registerbundles (Bundletable.bundles); } public void Application_BeginRequest (object sender, EventArgs e) {HttpApplication obj = se NDEr as HttpApplication; Obj. Context.Response.Write ("1 application_beginrequest<br/>"); } public void Application_resolverequestcache (object sender, EventArgs e) {HttpApplication obj = sender as HttpApplication; Obj. Context.Response.Write ("6 application_resolverequestcache<br/>"); public void Application_postresolverequestcache (object sender, EventArgs e){HttpApplication obj = sender as HttpApplication; Obj. Context.Response.Write ("7 application_postresolverequestcache<br/>"); } public void Application_prerequesthandlerexecute (object sender, EventArgs e) {HttpApplication obj = sender as HttpApplication; Obj. Context.Response.Write ("one application_prerequesthandlerexecute<br/>"); } }}
The following is a flowchart of the MVC overall request, from the Intelligence podcast Black Horse Training Course
ASP. NET WebForm Overall request flow chart, from Intelligence podcast Black Horse Training Course