1. Serialize dt into json and put it in the hidden control [hidBoundary] in the foreground:
string json = JsonConvert.SerializeObject(dtTemp);
this.hidBoundary.Value = json;
Need to reference Newtonsoft.Json.dll
2. Get the data in dt from the foreground hidden space
var boundaryDiv = $('#hidBoundary');
if (boundaryDiv != undefined && boundaryDiv.length != 0)
{
var jsonString = boundaryDiv.val();
_jsonBoundary = jQuery .parseJSON(jsonString);
}
The parseJSON method of jQuery is used to parse the data into json format.
Vice versa, if you want to convert the json data in the frontend to the DataTable in the backend, just use the opposite method.