Reputation: 13083
I'm using this code in my view to enumerate routes but I am unable to get route names from Route object.
RouteCollection routes = RouteTable.Routes; foreach (RouteBase rb in routes) { Route route = rb as Route;
So how can I get access to route name?
Upvotes: 3
Views: 1624
Reputation: 13083
I've also found this solution by Stephen Walter which enables us to keep the code unmodified (use MapRoute method instead of MapRouteWithName as described in the another solution at Stack):
Upvotes: 1