What is the best way to store a route according to all nice patterns?
We have a class that returns a list with menu items. These items are then rendered into the main menu. Once you hover over an item in the menu, an ajax call is made. This means that i have to store the path and parameters for this call in the menu item. What is the best way to store this information? I was thinking about a RouteValueDictionary but how can i convert one of those into a fully functioning route?
We are using Mvc 3 and C#.
This might work for you:
In your view, you could do something like this:
If all you need is the path, you can do this:
@Url.RouteUrl(menuItem.RouteValues)