I am trying to add an int [] array to my Url.Action like this:
var routeData = new RouteValueDictionary(); for (int i = 0; i < Model.GroupsId.Length; i++) { routeData.Add("GroupsId[" + i + "]", Model.GroupsId[i]); }
in my opinion:
Url.Action("Index", routeData)
but in html i get:
GroupsId%5B0%5D=1213&GroupsId%5B0%5D=1214
and not:
GroupsId=1213&GroupsId=1214
I need this because I have a list of checkboxes, and when I post a message, I bind groupIds to int [], and then go on to view where I have an export button with Url.Action, which doesn't work correctly for me.
Sasha
source share