1

的结果

@Html.RouteLink("link-name" , "route-name" , new 
{
  id = "8850" ,
  title = "sample-title" ,
  description = "sample-description"
}
)

<a href="/8850/sample-title/sample-description/">link-name</a>

有没有只提供href地址的扩展方法?

4

1 回答 1

4

您可以使用“Url.Action”

UrlHelper 类的:

Action(string actionName, string controllerName, RouteValueDictionary routeValues);

对于其他重载,请检查:

UrlHelper.Action 方法

例如。

<a href="@Url.Action(actionName, controllerName, routeValues)">link-name</a>
于 2012-06-07T12:45:46.777 回答