質問

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

役に立ちましたか?

解決

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)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top