I am using datatable.js with MVC4 web application. I am try to pass array data in fnServerParams.
Here I create a array object called array to passing data to server side.
Please see my code below:
function GetTaxInvoices(IsInital, TaxInvoiceIds) {
alert("message : IsInital :- " + IsInital + " , TaxInvoiceIds :- " + TaxInvoiceIds);
var elementName = "#tblCreatedTaxInvoices";
ClearData(dtTable2);
var array = [51, 52];
ajaxUrl = (IsInital) ? null : '@Url.Action("GetCreatedTaxInvoices", "Invoice")';
dtTable2 = $(elementName).dataTable({
bProcessing: true,
bLengthChange: false,
sAjaxSource: ajaxUrl,
traditional: true,
"fnServerParams": function (aoData) {
aoData.push(
{ "name": "TaxInvoiceIds", "value": array }
);
},
aoColumns: [
{ sTitle: "Id", bSortable: false, bVisible: false, },
{ sTitle: "PoBox Number", bSortable: false, },
{ sTitle: "Email", bSortable: false, },
{ sTitle: "Owner", bSortable: false, },
{ sTitle: "General Tax", bSortable: false, },
{ sTitle: "Consumption Tax", bSortable: false, },
{ sTitle: "Due Amount", bSortable: false, },
{ sTitle: "Date", bSortable: false, },
{ sTitle: "Detailes", bSortable: false, },
],
});
}
But it always shows null.

long[] TaxInvoiceIdstostring[] TaxInvoiceIdsor even juststring TaxInvoiceIds?