158
rated 0 times
[
160]
[
2]
/ answers: 1 / hits: 25393
/ 8 Years ago, tue, january 3, 2017, 12:00:00
I have a JSON object with nested arrays which I would like to send to a controller.
This is my jQuery.ajax call:
$.ajax({
url: @Url.Action(ExportJson),
type: POST,
data: JSON.stringify(myObj),
contentType:application/json,
success: function (result) {
}
});
Controller:
public ActionResult ExportJson(string json)
{
return null;
}
Why is the json string coming back as null in the controller? Whereas console.log(JSON.stringify(myObj)) shows the correct object in browser console.
More From » jquery