我有这样的动作:
@Html.ActionLink(dinner.Title, "Details", new { id=dinner.DinnerID })
和这样定义的路线:
routes.MapRoute(
"PrettyDetails",
"{Id}",
new { controller = "Dinners", action = "Details" },
new { Id = @"\d+" }
);
动作链接呈现<a href="/234">My Dinner</a>
为什么链接中不显示"Details"
?是因为它知道 Global.asax 中定义的路由,因此以某种方式匹配模式吗?
谢谢