I got it to work finally. The missing part from my previous code is the 'dataSrc'. I have to tell datatables.net to load data from response.d which the data from server.
Thanks for looking at this issue.
$(document).ready(function () {
var refDataTable = $("#example").dataTable({
processing: true,
bserverSide: true,
ajax: {
data: {},
type: "POST",
url: "BolAddress.aspx/GetAddress",
contentType: "application/json; charset=utf-8",
dataType: "json",
dataSrc: function (response) {
return response.d;
},
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.responseText);
}
},
"columns": [
{ "data": "CardId" },
{ "data": "CardType" },
{ "data": "Company" },
{ "data": "Address" },
{ "data": "City" },
{ "data": "State" },
{ "data": "Zip" },
{ "data": "Phone" },
{ "data": "Contact" },
{ "data": "Description" }
]
})
});