如何设置网址/customer/export/billing
到控制器Customer.ExportBilling()
的路由?
当我尝试这个时:
routes.MapRoute(
"exportCustomerBilling", "customer/export/billing", new { controller = "Customer", action = "ExportBilling" });
我得到404,没有调用控制器方法。
使用<%= Html.RouteLink("Export customers for billing", "exportCustomerBilling", null) %>
返回正确的链接,点击它会返回404。
答案 0 :(得分:1)
您可能在出口结算路线上方注册了更为通用的路线。
将Routing Debuggers中的一个放入您的网站,并在Global.asax中注册,它会告诉您:
你通常可以从那里找出你需要做的调整。