本篇主要講述MVC處理請求時創(chuàng)建Controller和執(zhí)行Action的完整過程。

創(chuàng)建Controller

先查看MvcHandler中處理請求的方法BeginProcessRequest:

大數據培訓,云培訓,數據挖掘培訓,云計算培訓,高端軟件開發(fā)培訓,項目經理培訓

        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

            {

                ……

            }

     }

網友評論