I currently have an IEnumerable view in a grid which I have added check boxes, to allow me to select items (which I grab the id's via JavaScript and build an array of just the id's).
I have a button which should send the array to a new action and load the corresponding view.
I attempted at first to send the array via a JSON object which worked, but I could not get the controller to load a new view, it just returns the results to the current view (not what I am wanting).
So I am now just trying the following :
window.location.href = '/TeamSelector/TeamList?array=' +SwimmerList;
This is working but the object is not being sent correctly as I receive nothing in the array at the controller end.
public ActionResult TeamList (List<int> Array)
{
// Do something here
return view(results)
}
Could somebody please advise me on how to structure the JavaScript code to send the array so that it will be accepted by the controller.
Any suggestion/advice would be greatly appreciated.
Andy.
/TeamSelector/TeamList?array=1&array=2&array=3etc