Is it posible with ajax to send one json-array (array with json objects) and also include a separate parameter to receive in MVC action method?
- by david2342
Is it posible with ajax to send one json-array (array with json objects) and also include a separate parameter to receive in MVC action method?
var n = {
number: 1
};
$.ajax({
type: "POST",
url: url,
contentType: "application/json; charset=utf-8",
dataType: "html",
data: JSON.stringify({jsonObjects:json, number:n}),
success: function (response) {
$('#body').html(response)
}
}
});
public ActionResult Create(List jsonObjects, int? number)
JsonObjects is comming in like it supposed to but number is null.