I am using below stuff to post list of object to controller ajax post method.
jQuery stuff:
var values = [];
values.push(rowData1);
values.push(rowData2);
values.push(rowData3);
var data = JSON.stringify({
installationControls: values
});
$.ajax({
url: '/ControllerName/fin',
type: "POST",
contentType: "application/json",
data: {
data: data
},
success: function () {
console.log('success!!');
}
});
Please suggest me what is wrong..
controller method:
[HttpPost]
public JsonResult fin(object s) {
//.................
}
posted data are as follow:
installationControls":[{"syID":"1789","FullName":"Bejin Mara","Min":"5","MSG":""},{"syStudentID":"46","FullName":"Calderon Laura","MinAbsent":"7","MSG":""},{"syID":"17","FullName":"mic Mayra","Min":"5","MSG":""}]
tried by creating same object and passed to controller argument but not worked.