Below is the java script code to populate my HTML table with server data, and I am using JQuery DataTables for this purpose.
function LoadData(result) {
$('#example').DataTable({
"ajax": {
"dataType": 'json',
"contentType": "application/json; charset=utf-8",
"type": "POST",
"url": "index.aspx/Risky",
"data": function (d) {
return JSON.stringify( d )
},
"dataSrc": function (json) {
return $.parseJSON(json.d);
}
},
"columns": [
{ "data": "Prctice_Group_Risk_No" },
{ "data": "Practice_Group" },
{ "data": "Risk_Category" },
]
});
}
Below is my code for the description of the web method
[WebMethod]
[ScriptMethod]
public static string Risky()
{
return JsonConvert.SerializeObject(riskList);
}
So far, his work is beautiful, my web method is being called, and my HTML table is populating.
But my problem is that I want to pass the result variable as a parameter to this ajax call so that my web method gets it and returns me certain data based on this parameter.
https://datatables.net/reference/option/ajax.data , ajax-, . java script , , , : " JSON" 500 Firebug. Firebug, "extra_search = 123"
, , , - json. , .
.