How to load server-side data in ASP.NET MVC ?

How to load server-side data in ASP.NET MVC ?

fa2020fa2020 Posts: 4Questions: 3Answers: 0
edited January 2022 in DataTables

I'm trying to use server-side data loading to fill the table. My view is:

Controller code:

The result is:

The output Json which controller returns is:

What is wrong in my code?


  • colincolin Posts: 14,713Questions: 1Answers: 2,511

    I was worried that the columnDefs after columns would cause an issue, but as you can see here, that's fine. Everything looks like it should work, though this thread may be an issue if you have backslashes in your returned data.

    If that doesn't help, could you link to your page so we can debug please,


  • allanallan Posts: 58,315Questions: 1Answers: 9,331 Site admin

    Your columns array is inside the ajax object, which is going to be at least part of the issue.

    Also you'll need to use ajax.dataSrc set to an empty string to tell DataTables to expect a plain array of data, rather than being wrapped in an object.


Sign In or Register to comment.