Let's go first. Diagram of the ASP. NET request mechanism by Preach Intelligence podcast Huadong Teacher
And then the teacher Zou added a diagram of the MVC request process
In fact, MVC is really. NETFramework a filter on the HttpModule in C:\Windows\Microsoft.NET\Framework\v4.0.30319
The <add name= "UrlRoutingModule-4.0" type= "System.Web.Routing.UrlRoutingModule" added in the configuration file below
The site will create this class at the first request and call its init () method to register on the event pipeline
1 browser sends HTTP requests to server IIS via messages
2IIS submit the request to the Extension module Aspnet_isapi.dll (c + + written unmanaged program, equivalent to IIS and the framework of the Intermediate program)
3 Framework Create HttpContext request context (Request/response/session/application/cookie/server ...)
4 Create Httpapplicaiton by HttpApplicationFactory Factory call it's PR method (event pipeline)
5 Seventh event creation Mvchanlder stored in HttpContext's private property Remaphandler (can be seen through. NET Reflector)
6 The eighth event is to judge whether the Remaphandler is empty if it is not empty httpcontent.remaphandler (Mvchandler);
7 A PR method that performs Mvchandler between 11/12 methods creates a Controller object
ASP. NET MVC Source code Analysis