Domanda

This is my actionlink:

@Html.Raw(HttpUtility.UrlDecode(Html.ActionLink("Comment", "Comment", new { id = item.NewsId, title = item.Title + "#disqus_thread"}).ToString()))

I would like to add Controller Name to it but when I try that I need to add a routevalue before.. I dont want do that.

Any kind of solutions or help is appreciated

È stato utile?

Soluzione

How about this overload?

public static MvcHtmlString ActionLink(
    this HtmlHelper htmlHelper,
    string linkText,
    string actionName,
    string controllerName,
    Object routeValues,
    Object htmlAttributes
)

ActionLink Code:-

Html.ActionLink("Comment", "Comment", "MyController",new { id = item.NewsId, title = item.Title + "#disqus_thread"},null)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top