我有一个看起来像这样的电话:
<%= Html.RouteLink(item.displayName, "DisplayCategory", new { category = Html.Encode(item.displayName), subcat = item.searchName }) %>
我得到的 html 看起来像这样:
http://localhost:1485/Home/ShowCategory/Electronics%20&%20Photography?subcat=electronics-photo
为什么 URL 以 "?subcat=electronics-photo" 而不是 "/electronics-photo" 结尾?它与路由定义有某种关系吗?
routes.MapRoute(
"DisplayCategory",
"Home/ShowCategory/{category}/{tags}",
new { controller = "Home", action = "ShowCategory", category = "", tags = "" }
);
任何线索将不胜感激!