Processing flow of ASP.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.