I have the following jquery
$('#example').tableDnD({
onDrop: function (table, row) {
alert(JSON.stringify($('#example').tableDnDSerialize()));
var data = JSON.stringify($('#example').tableDnDSerialize());
$.post("/admin/ReorderNews", data, function (theResponse) {
$("#response").html(theResponse);
});
},
dragHandle: ".dragHandle"
});
Here is the sample data: example[]=&example[]=1&example[]=2&example[]=
I m storing the information of table within data, when i post the data to /admin/ReorderNews/
which is as follows:
[HttpPost]
public ActionResult ReorderNews(string data)
{
return Content("ok");
}
it returns OK. however while I m debugging i see that data is null.
How can i fix this?
Try the data as {“data”:data} in post method and use string data in actionresult.
Thanks