Passing Data as a parameter in ajax call data binding

Passing Data as a parameter in ajax call data binding

Priyanka_mallickPriyanka_mallick Posts: 6Questions: 3Answers: 0

Hi,

I need help in binding data through ajax calls. I am passing method name which is in OData Service. Below is the code

$("#Example").DataTable({
"columnDefs": [
{
"orderable": false, "targets": 8
}
],
"aaSorting": [],
"bProcessing": true,
"bDeferRender": true,
"ajax": {
url: serviceUrlQuery,
type: 'POST',
data: JSON.stringify(userDetails),
contentType: "application/json; charset=utf-8",
async: false,
success: function (data) {
alert("Hi");
},
error: function (xhr, ajaxOptions, thrownError) {
alert("Sorry an error occured while connecting to service.");
}
}
});

With the above code, it is hitting the method but parameters which I am passing through "data" is null.

Thank you for your time

This discussion has been closed.