当我尝试运行该网站时,我收到此错误。
控制器类型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");
}
}
}
答案 0 :(得分:1)
问题是您已将控制器SiteLayoutControllers
(复数)命名为SiteLayoutController
。把它改成后者应该解决它