本篇主要讲述MVC处理请求时创建Controller和执行Action的完整过程。

创建Controller

先查看MvcHandler中处理请求的方法BeginProcessRequest:

大数据培训,云培训,数据挖掘培训,云计算培训,高端软件开发培训,项目经理培训

        protected internal virtual IAsyncResult BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, object state)

        {

            IController controller;

            IControllerFactory factory;

            ProcessRequestInit(httpContext, out controller, out factory);

            IAsyncController asyncController = controller as IAsyncController;            if (asyncController != null)

            {

                ……

            }            else

            {

                ……

            }

     }

网友评论