Request, according to IP and port, received by the IIS server, if it is a static file directly return the contents of the file, if unable to resolve, according to the mapping rules to find the corresponding request suffix
Aspnet_isapi.dll processing assembly to be processed by it.
1. Isapruntime is generated, which creates the Workrequest object,
2. Next instantiate the httpruntime, which generates the HttpContext context object, which initializes the request,response,session,application, and other built-in objects,
3. Then created the HttpApplicationFactory factory object, which called the Application_Start method in the global file on the first visit,
Generate the HttpApplication object, read the system's configuration file, which includes our routing configuration and constraints, and create Httpmodel objects, call the Init method, and register these methods into the pipeline,
4. Called by the HttpApplication object ProcessRequest, which is responsible for executing the pipeline time
4.1 The first is that the event is the BeginRequest method, and then the focus comes to the 7th time, creating the Mvchandler object,
4.1.1 the HttpContext into it and reads the routing rules in the routing table to generate the Routedata object, and HttpContext it together to create RequestContext, Then requestcontext the object into the Roudlerhandler.gethttphandler to get Mvchandler, and call Context.remaphandler Mvchandler into HttpContext
4.2 The 8th event checks whether Remaphandler is empty in HttpContext, skips this event if it is not empty, which is also one of the most important differences with ASPX, which is to build the page control tree in ASPX. and. NET MVC is skipped here.
4.3来 to the 11th to 12th events, the controller factory is obtained according to the controller name to create the corresponding controller object, passing in the RequestContext call the controller parent class Controllerbase's Execute method, The RequestContext is set to ControllerContext, which executes the Executecore method, which finds and invokes the corresponding action method according to the requested method name, which is the business we write, and finally returns to view, Call the Actionresult.execute method, which is the parent class's Viewresultbase.executeresult, find the corresponding view engine, get the Viewengineresult view object, Get response TextWriter object and ViewContext object to invoke the engine's render method, generate HTML code and writer out.
Overview of the principles of 1..net MVC