protected virtual CMSPageDefaultController initPageController() { CMSPageDefaultController pageController = new CMSPageDefaultController(); pageController.init(this.Request.RequestContext); //change route data, otherwise mvc 404 page will not have view applied, since it will not be able to load view pageController.ControllerContext.RouteData.Values["controller"] = "CMSPageDefault"; pageController.ControllerContext.RouteData.Values["action"] = "Index"; return(pageController); }
protected virtual CMSPageDefaultController initPageController() { CMSPageDefaultController pageController = new CMSPageDefaultController(); pageController.init(this.Request.RequestContext); //change route data, otherwise mvc 404 page will not have view applied, since it will not be able to load view pageController.ControllerContext.RouteData.Values["controller"] = ConfigurationManager.AppSettings["BaseControllerName"] .ToNullOrEmptyHelper() .Return("CMSPageDefault"); pageController.ControllerContext.RouteData.Values["action"] = "Index"; return(pageController); }