Using Datatables with c# MVC/WEB API...

Using Datatables with c# MVC/WEB API...

LoftenPierceLoftenPierce Posts: 5Questions: 2Answers: 0

I'm really new here, but I think your product is awesome! Is there documentation on how to implement this for c# MVC and /or web api? I see documentation on the Editor for it, but I didn't see it for datatables? Can you point me in the right direction? Thanks I will be purchasing the Editor. It's just awesome.

Answers

  • LoftenPierceLoftenPierce Posts: 5Questions: 2Answers: 0

    Love your products! Looking forward to getting up to speed on this so I can apply it to my projects!

  • allanallan Posts: 63,771Questions: 1Answers: 10,510 Site admin

    There isn't an example of using DataTables alone with C#. To be honest, DataTables doesn't really care what the data source is - as long as it is JSON (or a DOM table). As long as you can get your server to return JSON, you can have DataTables work with that data - see the Ajax manual page.

    Allan

  • LoftenPierceLoftenPierce Posts: 5Questions: 2Answers: 0

    Thanks for returning my post. I can get a JSON result, but what do I need to do to receive it into my MVC view? Do I need to do any JQuery and/or JavaScript? Thanks for your support.

  • allanallan Posts: 63,771Questions: 1Answers: 10,510 Site admin

    I'm not sure that JSON would be much use in your MVC view - you want DataTables to read the JSON, not your view.

    Have a look at this example. You'll be able to see (particularly if you use your browser's inspector tools) that DataTables makes a request to the server to get data, and the server responds with the required JSON.

    Allan

  • LoftenPierceLoftenPierce Posts: 5Questions: 2Answers: 0

    I apologize for the mistake. I would generally populate a view model or model with the JSON result and that would populate the views. I will be really be drilling down on this. I will get it. Thanks for your support.

This discussion has been closed.