【发布时间】:2013-07-26 21:05:46
【问题描述】:
如何调用任一
RenderAction or Partial
我尝试了以下两种方法
@Html.RenderAction("Link", Moorestown.Models.FooterMenu);
@Html.RenderPartial("Link", Moorestown.Models.FooterMenu);
这位于我的共享视图中,但我正在尝试调用页脚链接的一部分,以便我可以拥有一个动态菜单。
错误是Moorestown.Models.FooterMenu is a type which is not valid in the following context。
我的 FooterMenu 控制器操作如下所示
public PartialViewResult Link()
{
return PartialView(db.FooterMenus.ToList());
}
我也有一个局部视图,但现在什么都没有,因为我什至不能正确地调用它
【问题讨论】: