MVC请求生命周期

时间:2014-05-22 00:47:10   收藏:0   阅读:408

简单流程:

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

MVC请求生命周期,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!