tags:

views:

48

answers:

1

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 upgrade?

+1  A: 

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") %>
Yuriy Faktorovich
Yes it was there.But the extension method was not found.
Dhya
Oops ,I have to use Html.LinkExtensions.ActionLink .
Dhya
No. That shouldn't be necessary. As along as it knows about the System.Web.Mvc.Html namespace, it should be able to resolve the extenion on the HtmlHelper without invoking the static method directly.
tvanfosson