I'm using ASP.Net MVC 2, and I've got a slight problem. I need to produce an url from a list of values.
Using the following code:
RouteValueDictionary dic = new RouteValueDictionary();
dic.Add("mylist", new [] { 1, 2, 3 });
return helper.Action(dic["action"] as string, dic["controller"] as string, dic);
I get the url /whatever/System.Int32[]
which obviously is not what I am after.
What is the ASP.Net MVC 2 preferred way of generating such an URL? I know the modelbinder can handle lists, but how to generate it?
A quick note on how it is done in MVC 3 would also be appreciated (if the method differs).