I have a variable that is a string[] parameter. I've tried to push values in the actionresult and have yet to match the string[] parameter. So my ajax:
var panels = [];
$('input.checkone').each(function (e) {
if ($(this).is(':checked')) {
var inputCheck = $(this).closest('tr').find('td:nth-child(6) a').text();
panels.push(inputCheck);
}
});
var data = { panels: panels };
$.ajax({
url: "/main/sub",
data: data,
}).etc...
So panels looks like panels: Array[1] 0:'test', and it goes to my controller:
public ActionResult sub(string[] panels)
{
//content
}
Currently the panels is going through like {string[1]}. I'm not sure why my strings aren't being passed in correctly and its being passed like {string[1]}.
innerHTMLinstead oftext?var data = { 'panels': panels };contentType: "application/json"?