How to submit data to Generic Handler in .Net
How to submit data to Generic Handler in .Net
Hi,
I was going through this article on the Editor
https://editor.datatables.net/examples/inline-editing/options.html
This article describes how you can use PHP to post the data for saving in the database.
I am trying to do the same in .Net using AJAX and Generic Web Handler. Right? My question is how to pass the currently edited cell/row data in json to WebHandler. Here is the sample code:
My call is going to the Web Handler but how do I pass the current cell/row data to AJAX call
var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function () {
editor = new $.fn.dataTable.Editor({
ajax: {
url: "SaveHandler.ashx?caller=save",
contentType: 'application/json',
data: function (d) {
return JSON.stringify(d);
}
},
table: "#example",
fields: [{
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:",
name: "position"
}, {
label: "Office:",
name: "office"
}, {
label: "Extension:",
name: "extn"
}, {
label: "Start date:",
name: "start_date",
type: "datetime"
}, {
label: "Salary:",
name: "salary"
}
]
});
Please help,
Thanks,
Karamvir Mor