运行umbraco网站时遇到问题

时间:2018-01-16 18:18:56

标签: asp.net .net asp.net-mvc umbraco controllers

当我尝试运行该网站时,我收到此错误。 控制器类型UmbracoBootstrapProject.Controllers.SiteLayoutControllers不遵循约定,MVC控制器类名称必须以术语“控制器”为后缀

namespace UmbracoBootstrapProject.Controllers
{
    public class SiteLayoutControllers : SurfaceController
    {

        private const string PARTIAL_VIEW_FOLDER = "~/Views/Partials/SiteLayout/";
        public ActionResult RenderHeader()
        {
            return PartialView(PARTIAL_VIEW_FOLDER + "_Header.cshtml");
        }
        public ActionResult RenderFooter()
        {
            return PartialView(PARTIAL_VIEW_FOLDER + "_Footer.cshtml");
        }
    }
}

1 个答案:

答案 0 :(得分:1)

问题是您已将控制器SiteLayoutControllers(复数)命名为SiteLayoutController。把它改成后者应该解决它