我认为有以下代码:
@Html.ActionLink(item.Title, "Articles/Details", New With {.id = item.ArticleId})它产生以下链接:
/博客/文章/详细资料/1
我想要它生产这个,而不是:
/条款/详细资料/1
我试着弄乱参数,但我不知道如何让它做我想做的事情。我该怎么做?谢谢。
发布于 2012-07-26 18:31:36
使用此overload
public static MvcHtmlString ActionLink(
this HtmlHelper htmlHelper,
string linkText,
string actionName,
string controllerName,
Object routeValues,
Object htmlAttributes
)这样你的代码就可以写成
@Html.ActionLink(item.Title, "Details","Article",
New With {.id = item.ArticleId},Nothing)检查this msdn page以查看所有可用的重载
https://stackoverflow.com/questions/11675723
复制相似问题