I have to make a json call to home controller where I need to pass multiple arrays.
var assetids = new Array(N);
var faultTimes = new Array(N);
var messages = new Array(N);
var curtailments = new Array(N);
//populate above arrays with values then make a JSON call
$.getJSON('Home/AcknowledgeMany', {
assetid: assetids,
loggedBy: $("#UserName").text(),
faultTime: faultTimes,
message: messages,
curtailment: curtailments
}, function (result) {
alert(result);
}
The homecontroller has following action result
public string AcknowledgeMany(int[] assetId, string loggedBy, string[] faultTime, string[] message, string[] curtailment)
{
return("Acknowledged");
}
I receive null values for all the arrays when I make this call. Can someone help me passing arrays.