Html.ActionLink could not be dynamically sent

I have a problem with MVC3

I am trying to use @Html.ActionLink() to create a link for titles in my blog project.

Using constant strings in ActionLink works just dandy, but if I use Posts.Title (the title of the current current Post model), I get this exception:

 CS1973: 'System.Web.Mvc.HtmlHelper<dynamic>' 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. 
+55
c # asp.net-mvc html-helper
Apr 29 '11 at 13:29
source share
1 answer

"Consider using dynamic arguments or calling an extension method without extension method syntax."

Posts.Title has no type (hence no dynamic argument).

Just enter it via (string) Posts.Title.

+108
Apr 29 2018-11-11T00:
source share



All Articles