ASP. net mvc request process

Source: Internet
Author: User

ASP. net mvc request process

I. Application startup

1. Application_Start method, program startup

  

2. Use the RegisterRoutes method to register a route

  

3. The System. Web. Mvc. RouteCollectionExtensions. MapRoute method shows the MvcRoutehandler object.

  

Ii. Request to enter

You can find "" in "$ \ Windows \ Microsoft. NET \ Framework \ version \ Config \ Web. config ""

The request passes through the System. Web. Routing. UrlRoutingModule. Init method.

1. System. Web. Routing. UrlRoutingModule. Init Method

  

2. System. Web. Routing. UrlRoutingModule. PostResolveRequestCache Method

  

3. System. Web. Routing. RouteCollection. GetRouteData Method

  

4. System. Web. Routing. Route. GetRouteDara Method

  

Here this. RouteHandler is an instantiated MvcRouteHandler object in the first part. Now we have obtained the MvcRouteHandler instance. continue to the next step and return Step 1:

2. System. Web. Routing. UrlRoutingModule. PostResolveRequestCache Method

  

3. The System. Web. Mvc. MvcRouteHandler. GetHttpHandler method returns the MvcHandler object.

  

4. System. Web. Mvc. MvcHandler Construction Method

  

If this class implements the IHttpHandler interface, you have to check the ProcessRequest method.

5. System. Web. Mvc. MvcHandler. ProcessRequest Method

  

6. System. Web. Mvc. MvcHandler. ProcessRequestInit Method

  

Return to Step 1

5. System. Web. Mvc. MvcHandler. ProcessRequest Method

  

6. System. Web. Mvc. ControllerBase. Excete Method

  

7. System. Web. Mvc. Controller. ExcuteCore Method

  

8. System. Web. Mvc. Controller. ActionInvoker attributes

  

9. System. Web. Mvc. Controller. CreateActionInvoker Method

  

Return the instance that implements the IActionInvoker interface, and return step 1.

7. System. Web. Mvc. Controller. ExcuteCore Method

  

8. System. Web. Mvc. ControllerActionInvoker. InvokeAction Method

  

9. System. Web. Mvc. ControllerActionInvoker. InvokeActionResult Method

  

10. The System. Web. Mvc. ActionResult class encapsulates the results of an operation method.

  

Let's take a look at the override of the derived class of the ExcuteResult ActionResult:

  

Choose the ExcuteResult method in the ViewResultBase class.

11. System. Web. Mvc. ViewResultBase. ExcuteResult Method

  

12. System. Web. Mvc. ViewResult. ExcuteResult Method

  

13. System. Web. Mvc. ViewEngineCollection. FindView Method

  

14. System. Web. Mvc. VirtualPathProviderViewEngine. FindView Method

  

Return to step 2

13. System. Web. Mvc. ViewEngineCollection. FindView Method

  

14. System. Web. Mvc. ViewEngineCollection. Find Method

  

15. System. Web. Mvc. ViewEngineCollection. Find Method

  

So far, we have obtained the ViewEngineResult object. ViewEngineResult indicates the result of locating the view engine.

Now let's go back to Step 1 and continue.

11. System. Web. Mvc. ViewResultBase. ExcuteResult Method

  

12. System. Web. Mvc. BuildManagerCompiledView. Render Method

  

13. The System. Web. Mvc. RazorView. RenderView method is used to display the page using the Razor view engine.

  

Related Article

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.