【发布时间】:2012-06-08 20:51:38
【问题描述】:
感谢您阅读本文。
在_Layout.cshtml页面我使用@RenderPage来调用header:
@RenderPage("/Shared/_header.cshtml")
它有这个:
<div id="Header"> Home </div>
想让它可点击到默认操作(“索引”)
当我尝试这个时:
<div id="Header"> @Html.Action("Index", "MyController") </div>
“操作”以红色下划线显示此错误:
'System.Web.WebPages.Html.HtmlHelper' does not contain a defintion for 'Action' and no extension ......
“System.Web.Mvc”在项目中以及配置文件中被引用:
<add namespace="System.Web.Mvc" />
有什么想法吗?
【问题讨论】:
标签: asp.net-mvc-3