我有一个剃须刀母版页(_Layout.cshtml),我在其中布置一个3列网站。在其中一个侧栏中,我想显示“登录控制”
从我的阅读中,我可以使用Html.RenderAction来调用我的LoginController,它将在侧栏中显示登录视图。
但是,当我运行它并将其指向Controller / View以填充RenderBody()时,对Html.RenderAction(“Index”,“LoginController”)的调用因此错误而失败。
"The controller for path '/[insert path to a Controller/View to fill the
RenderBody()]' was not found or does not implement IController. "
那么,我做错了什么?
我的代码真的很简单:
@RenderBody()
@{ Html.RenderAction("Index", "LoginController");}
在我的控制器文件夹中,我有RenderBody和LoginController的控制器。