0

I'm using 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?

Omar
  • 39,496
  • 45
  • 145
  • 213
Jhorra
  • 6,233
  • 21
  • 69
  • 123

1 Answers1

2

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.

René Wolferink
  • 3,558
  • 2
  • 29
  • 43