开发者

Problem with custom routes

开发者 https://www.devze.com 2023-01-06 11:42 出处:网络
I\'m us开发者_如何学JAVAing the following route routes.MapRoute( \"PatientList\", \"User/{SearchName}/{LocationID}/{Page}\",

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消