From within a Controller's action, how can I get the current route information?
How can I loop through the other routes?
From within a Controller's action, how can I get the current route information?
How can I loop through the other routes?
RouteData
is a key/value collection:
this.RouteData.Values["controller"];
..will return the controller of the current route.
this.RouteData.Values["action"];
..will return the action, etc..