Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
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):
http://stephenwalther.com/blog/archive/2008/08/03/asp-net-mvc-tip-29-build-a-controller-to-debug-your-custom-routes.aspx
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.