我的路线:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//Add a custom Route that implements IRouteHandler
Route metadata = new Route("metadata", new MetadataRoute());
routes.Add("Metadata", metadata);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
我的观点: @ Html.ActionLink(“主页”,“索引”,“主页”)
所需的客户端html: HREF = “/”
实际的客户端html: HREF = “/元数据行动=索引&安培;控制器=首页”
有没有办法让Html.ActionLink忽略元数据路由?
由于
答案 0 :(得分:0)