I learned about MVC 3, and I could not understand one aspect of routing.
If I have a route, for example below:
routes.MapRoute("Default", "{controller}/{action}/{ID}");
The route restricts each action to only one name identifier parameter! Although there are no restrictions on the name of the controller or action for this route.
Of course, I could define more routes, but there should be a better way for the route to accept data tokens such as ListID or FieldID.
For example: I have a ListController with two actions:
GetListByID(int listID) and GetFieldByID(int fieldID)
In this case, I have to define two routes, because the function parameter name is different. Is there a better way to do this? Thanks!
source share