Question

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

Was it helpful?

Solution

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top