Basically I have a list of Guids and I want to pass this list as a parameter to a controller action. This is what I come up with so far, but its not working.
var contactsParam = new Dictionary<string, object>();
var count = 0;
foreach (var selectedUserId in selectedUserIds)
{
contactsParam.Add("selectedUserId[" + count + "]", selectedUserId);
count++;
}
@Html.ActionLink("Edit", "SomeAction", "Controller", new RouteValueDictionary(contactsParams), null)
Then this is the controller action
[HttpGet]
public ActionResult SomeAction(Guid[] selectedUserIds)
{}
I've tried to pass through just a basic list on its own, and also an IEnumerable, however they both send through 0 results. I've searched online and found what I have above, but it doesn't seem to be working.
Can you suggest anything?