配置了以下路由
routes.MapRoute(
"List",
"Products/List/{Category}_C{CategoryID}_{Keyword}_{CurrentPage}.html",
new { controller = "Products", action = "List", Keyword = UrlParameter.Optional, CurrentPage = 1 }
);其中Keyword是搜索关键字,这个可能为空,所以我Keyword = UrlParameter.Optional但在测试的时候以下地址是无法浏览的,显示404http://localhost/Products/List/Other-Auto-Parts_C76__1.html
必须要在Keyword的加上内容另外我在测试的时候,好像地址中参数与参数之间必须要/分隔,然后可空参数才能起作用!请问我哪里做的不对??谢谢
routes.MapRoute(
"List",
"Products/List/{Category}_C{CategoryID}_{Keyword}_{CurrentPage}.html",
new { controller = "Products", action = "List", Keyword = UrlParameter.Optional, CurrentPage = 1 }
);其中Keyword是搜索关键字,这个可能为空,所以我Keyword = UrlParameter.Optional但在测试的时候以下地址是无法浏览的,显示404http://localhost/Products/List/Other-Auto-Parts_C76__1.html
必须要在Keyword的加上内容另外我在测试的时候,好像地址中参数与参数之间必须要/分隔,然后可空参数才能起作用!请问我哪里做的不对??谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货