Consider that I have the following javascript that do a post:
$.post("/MyController/SomeAction",
{ myParam: ['Filip', 'Ekberg'] }, function(data) { alert(data); }, "html");
My Action looks like this:
[HttpPost]
public ActionResult SomeAction(FormCollection collection,
IEnumerable<string> myParam)
{
return null;
}
When I enter this Action, myParam is null, if I expand the FormCollection I see this:
The weird part here is that the name ( Key ) is myParam[]
which might be why it is not mapped to myParam
.
Also, I tried doing dynamic[] myParam
as well, but it doesn't work either.
I know that I can use JSON.stringify
but I don't want to do that now. So, any ideas what's going on here and if there is a solution?