Before the notes are placed in the space log hidden, today see this sentence: As often from the online request for free information of a member, to have the idea of return, but also in order to let more people take a few detours, think that they can not be so selfish, so the space log to move to the blog park. Gossip doesn't say, start straight.
ASP. NET MVC is divided into the main controller, Action, and views
The following is an analysis of the process flow for asp:
The Controller is responsible for getting the model data and passing the Model A View object, notifying the View object to display.
Processing Flow:
1. User initiated request---urlrouting GET request-"Mvcroutehandler.gethttphandler ()->mvchandler.processrequest () 2." Urlrouting get browser-initiated requests
Merge Routdata and HttpContext into RequestContext passed to Irouthandler interface, Irouthandler interface implementation Class Mvcroutehandler interface to RequestContext parameter, Returns a Mvchandler object and assigns a value to the object RequestContext
3.MvcHandler objects
The Routedata and HttpContext are resolved according to the RequestContext parameter, and the controller and the object's action and its parameters are found according to the Routedata.
4.MvcHandler. Process flow of the ProcessRequest () method
The Mvchandler object is obtained according to the factory method to the specific controller---->controller.execute ()---> Release controller object
The most important of these is that the Mvchandler object gets to the specific controller based on the incoming RequestContext parameter and executes its execute () method
5.controller.execute () method processing process Find action
Get the action---> Call the Actionresult.executeresult () method of the ActionResult (abstract method)
6.actionresult.executeresult () method
Get to the IView object,---"based on the page path of the IView object to the concrete page,---> Call Iview.renderview () method to display the page
The IView object stores the path address of the page, and eventually uses that path to generate the specific page class through the page engine (View engine), ViewPage (System.Web.Mvc.ViewPage) is the object that implements the IView interface.
7, the final page will be displayed correctly.
Viewpage.renderpartialview () displays the. ascx file or Viewpage.renderview () to display the. aspx file.
Now MVC 3 uses the Razor view engine, the same process as Webformviewengine
Processing flow of ASP.