0

これは私のアクションリンクです:

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

コントローラー名を追加したいのですが、それをしようとすると、前にルート値を追加する必要があります..私はそれをしたくありません。

どんな種類の解決策や助けも大歓迎です

4

1 に答える 1

0

このオーバーロードはどうですか?

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)
于 2013-05-30T16:45:27.410 に答える