How do I send back an array of values back to a controller action via $.get?
I have tried (string[] values) and (List).
...
var val = $('#CStatus').val(); // Get a list of selected values
alert(val); // Displays 0,1
$.get('@Url.Action("GO")', { junk: val }, function (data) {
$('#gridview').html(data);
});
public ActionResult GO(List<String> junk /* or string[] junk or string junk*/)
{
// junk is null!
}
The following was even failing
But this fixed it:
Here is a good article describing the issue.
With the following Controller ActionResult Sig: