data Fetching url calling twice. script attached.
$(document).ready(function () {
$('#tCity').DataTable(
{
"order": [[2, "asc"]],
"pagingType": "numbers",
"columnDefs": [
{ "className": "text-center custom-middle-align", "targets": [0], "width": "7%", "searchable": false, "orderable": false },
{ "className": "text-center custom-middle-align", "targets": [1], "width": "10%", "searchable": true, "orderable": true, "visible": false },
{ "className": "text-left custom-middle-align", "targets": [2], "searchable": true, "orderable": true },
{ "className": "text-center custom-middle-align", "targets": [3], "width": "10%", "searchable": true, "orderable": true, "visible": false },
{ "className": "text-left custom-middle-align", "targets": [4], "searchable": true, "orderable": true },
{ "className": "text-center custom-middle-align", "targets": [5], "width": "8%", "searchable": false, "orderable": false },
],
"language":
{
"processing": "<div class='overlay custom-loader-background'><i class='fa fa-cog fa-spin custom-loader-color'></i></div>"
},
"processing": true,
"serverSide": true,
"ajax":
{
"url": "City.aspx/GetCityList",
"contentType": "application/json",
"type": "GET",
"dataType": "JSON",
"data": function (d) { return d; },
"dataSrc": function (json) {
json.draw = json.d.draw;
json.recordsTotal = json.d.recordsTotal;
json.recordsFiltered = json.d.recordsFiltered;
json.data = json.d.data;
return json.data;
}
},
"columns": [
{ "data": "RowNumber" },
{ "data": "iCityId" },
{ "data": "strCity" },
{ "data": "iStateId" },
{ "data": "strState" },
{ "data": "Action" }
]
});
});