I have a requirement to dynamically change a ASP.NET MVC route depending on the contents of the URL.
For example:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}/{value}",
new { controller = "Home", action = "Index", id = 0, value = "" }
);
I'd like to use the above route for most scenarios but also allow {controller}/{value} in certain cases.
How can this be done with ASP.NET MVC?