我如何在actionlink中插入控制器名称而不添加其他东西



这是我的actionlink:

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

我想添加控制器名称,但当我尝试,我需要添加一个routevalue之前…我不想那样做。

任何形式的解决方案或帮助是感激

这个超载怎么办?

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

ActionLink代码:

Html.ActionLink("Comment", "Comment", "MyController",new { id = item.NewsId, title = item.Title + "#disqus_thread"},null)

最新更新