Hi everyone,
I have a route defined with several hardcoded (non-parameter) segments:
routes.MapRoute(null, "suggestion/list/by/{tag}",
new { controller = "Suggestion", action = "List", tag = UrlParameter.Optional });
Suppose I'm in the Index view of SuggestionController, which has a Suggestion object for Model, how can I create a link that matches that route?
I know I can accomplish I by using plain ol' html like:
<a href="/suggestion/list/by/<%=Model.Tag %>"><%=Model.Tag %></a>
But this makes it impossible to pass on other route parameters (as a RouteValueDictionary, for instance), doesn't it?
I was actually wondering whether is would be possible to do using one of the provided helpers, but without naming the route. I'd prefer to keep the route name as null in order to avoid hard-coding to much on my views, but I can't figure out how to user these non-parameter segments in Html.ActionLink or RouteLink methods.
Any ideas?
Thanks in advance.