Problem with custom routes
I'm us开发者_如何学JAVAing the following route
routes.MapRoute(
"PatientList",
"User/{SearchName}/{LocationID}/{Page}",
new { controller = "User", action = "Index", SearchName = "", LocationID = 0, Page = 1 }
);
It fails on the following URL: /user//1/1
Can anyone tell me what I'm doing wrong?
The URL /user//1/1
is interpreted by ASP.NET as a request for /user/1/1
. Only the last parameters can be optional. You can't skip a parameter this way.
精彩评论