In ASP.NET MVC, can routes be defined that can determine which controller to use based on the data type of the URL part?
For example:
routes.MapRoute("Integer", "{myInteger}", new { controller = "Integer", action = "ProcessInteger", myInteger = "" }); routes.MapRoute("String", "{myString}", new { controller = "String", action = "ProcessString", myString = "" });
Essentially, I want the following URLs to be handled by different controllers, although they have the same number of parts:
MYDOMAIN / 123
MYDOMAIN / ABC
PS The above code does not work, but it indicates what I want to achieve.
c # asp.net-mvc url-routing
Moose factory
source share