I was wondering how I can pass data to datatable.net in an asp.net mvc 4 application.
like this example: http://www.datatables.net/release-datatables/examples/data_sources/ajax.html
The output format I want is like this, but I can't figure out how to produce this result:
{
"aaData": [
[
"Trident",
"Internet Explorer 4.0",
"Win 95+",
"4",
"X"
],
[
"Trident",
"Internet Explorer 5.0",
"Win 95+",
"5",
"C"
]
]
}
So far I have something like this:
public JsonResult GetDataList(int? assetId)
{
var tableData = DBData.ToList();
var res = new JsonResult
{
JsonRequestBehavior = JsonRequestBehavior.AllowGet,
Data = ??? // I must do something here with tableData
};
return res;
}