views:

122

answers:

1

From within a Controller's action, how can I get the current route information?

How can I loop through the other routes?

+2  A: 

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..

cottsak