Just started experimenting with routing. There is such a construction:
routes.MapRoute( "1", "{controller}/{1}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "2", "{controller}/{2}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "3", "{controller}/{3}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "12", "{controller}/{1}/{2}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "13", "{controller}/{1}/{3}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "23", "{controller}/{2}/{3}", new { controller = "Controller", action = "Action" } ); routes.MapRoute( "123", "{controller}/{1}/{2}/{3}", new { controller = "Controller", action = "Action" } ); The idea is clear: to make it so that deleting a line (or not sending a line) of one or several parameters (including in the middle) does not lead to errors.
When the parameter 3 is a small problem, but it is worth to increase them at least twice, because it requires a much larger code. Of course, this ultimately concerns a predictable number of parameters.
Maybe I do not see a better way to generate correct routing.
PS: If you are interested, then I use such a routing for a flexible filter of an online store: thus the line is deprived of the mention of unnecessary defaults, it looks more accurate and CNC-shnoy.
?the parameters that are in action, but not in the route are taken from there - Grundy