【发布时间】:2017-02-20 01:33:31
【问题描述】:
我有 2 条不同的路线:
context.MapRoute(
"zyzzyva_default",
"{urlTitle}",
new { area = "zyzzyva", action = "Index", controller = "Home", urlTitle = UrlParameter.Optional }
);
第二个:
context.MapRoute(
"Vip_default_vip_thankyou",
"{partnername}-vip-thank-you",
new { controller = "Vip", action = "ThankYou", partnername = "" },
new string[] { "Web.Areas.Vip.Controllers" }
);
当我转到mydomain.com/aaaa-vip-thank-you 时,它应该使用第二条路线,但我不明白为什么它使用第一条路线。
【问题讨论】:
-
第一条路线太笼统了。路由适用于按注册顺序找到的第一个匹配项。
标签: c# asp.net-mvc asp.net-mvc-routing asp.net-mvc-areas