简单流程:
-
Request 请求到来
-
IIS 根据请求特征将处理权移交给 ASP.NET
-
UrlRoutingModule 将当前请求在 Route Table 中进行匹配
-
UrlRoutingModule 在 RouteCollection 中查找 Request 匹配的 RouteHandler, 默认是 MvcRouteHandler MvcRouteHandler 创建 MvcHandler 实例 .
-
MvcHandler 执行 ProcessRequest.
-
MvcHandler 使用 IControllerFactory 获得实现了 IController 接口的实例 , 找到对应的 HomeController
-
根据 Request 触发 HomeController 的 Index 方法
-
Index 将执行结果存放在 ViewData
-
HomeController 的 Index 方法返回 ActionResult
-
Views/Home/Index.aspx 将 ViewData 呈现在页面上
-
Index.aspx 执行 ProcessRequest 方法
-
Index.aspx 执行 Render 方法 输出到客户端