结果
@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地址的扩展方法?
请您参考如下方法:
您可以使用"Url.Action":
UrlHelper 类:
Action(string actionName, string controllerName, RouteValueDictionary routeValues);
对于其他重载,检查这个:
例如。
<a href="@Url.Action(actionName, controllerName, routeValues)">link-name</a>
