Getting error as following..
Compiler Error Message: CS1973: 'System.Web.Mvc.HtmlHelper' has no applicable method named 'ActionLink' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
In MVC application,I'm trying to use a dictionary entry's key as link text of a link, but im getting error.
This is the line where i'm getting error...i tried replacing item.Key with @item.Key and various other ways too.
@Html.ActionLink(item.Key,"ExpandFolder","Home",new {path=item.Key },null)
My entire view code looks like this...
<form id="ViewFiles" method="post" action="Index">
<ul>
@foreach (var item in @ViewBag.filesFolders)
{
if (item.Value == "folder")
{
<li>
@Html.ActionLink(item.Key,"ExpandFolder","Home",new {path=item.Key },null)
</li>
}
else if (item.Value == "file")
{
<li><a href="">FILES-@item.Key</a></li>
}
}
</ul>
</form>