开发者

ASP.NET MVC - Version clarification

I am using VS 2008 and MVC 1.0.

When i try to execute

<%=Html.ActionLink("DisplayHello",
new {Controller="SayHello",Action="DisplayHello"}) %>

it throws

System.Web.Mvc.HtmlHelper does not contain a definition for "ActionLink".

I am using MVC Version System.Web.Mvc.dll (1.0.40310.0)

Question

What version do i need to upgrad开发者_JAVA技巧e?


Your version of MVC contains the ActionLink Extension. You likely have a namespace issue. Make sure your web.config includes the following:

<add namespace="System.Web.Mvc.Html"/>

Also note your link is in incorrect format:

<%=Html.ActionLink("DisplayHello", "DisplayHello", "SayHello") %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜