Hello
I'm trying to programatically generate a link by routename and routevalues. I store the routes and values in the database.
How can I adjust this helper in order to make it work?
public static string GenerateLink(this HtmlHelper helper, string routeName, Dictionary<string, string> parameters)
{
// ??
RouteValueDictionary rd = new RouteValueDictionary();
foreach (var item in parameters)
{
rd.Add(item.Key, item.Value);
}
// string url = ??
return url;
}
to use it like:
<%= Html.GenerateLink(Model.SomeLinkName, Model.RouteName, ..?) %>
/M