I am trying to send a javascript object to my MVC method in VS 2010. Using the VS web server.
$.ajax({
type: "POST",
url: "@Url.Action("Filter", "Grid")",
dataType: "json",
data: {"data": JSON.stringify(filtersData) },
contentType: "application/json; charset=utf-8",
traditional: true,
success: function (data) {
alert("ok");
},
error:function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
When adding the contentType parameter is causes the 500 error. What am i doing wrong?