0

我正在使用以下路线

routes.MapRoute(
    "PatientList",
    "User/{SearchName}/{LocationID}/{Page}",
    new { controller = "User", action = "Index", SearchName = "", LocationID = 0, Page = 1 }
); 

它在以下 URL 上失败:/user//1/1

谁能告诉我我做错了什么?

4

1 回答 1

2

URL/user//1/1被 ASP.NET 解释为对/user/1/1. 只有最后一个参数可以是可选的。您不能以这种方式跳过参数。

于 2010-07-09T21:32:49.517 回答