Datatables using in Asp.net C#
Datatables using in Asp.net C#
Zar
Posts: 1Questions: 1Answers: 0
I am the beginner of DataTables and can I get the examples of how to use the data tables in client and server side using C#.
This discussion has been closed.
Answers
I'm an asp.net developer also. Most of dataTables is initialization through javascript. After your second table, you'll want to start crafting a class structure so you can initialize the table through a new class method. The only major difference that I've run into between php and .asp is that you need to craft your own SQL statements which in my humble opinion is the better route anyways.
Things I do -
Always use an ajax page to return data to dataTables
Always ready data in a json format from your ajax page.
I started out by first just applying the table initialization to a table that was already HTML rendered through my .net code for just the sorting / filtering features in dataTables.
After that, we moved to using ajax to load data on an empty table.
After that, we moved to full class instantiated tables.
myTable = new jqDataTable("tableName", ajaxSource:=...., options galore .....)
So, I would start by rendering your table like you always do, then just add the script to initialize the table trough dataTables. Then you can start figuring out why you are loading your table content in the manner you are and if it makes sense to move that off to an ajax function (which, of course, it will make sense).
Don't forget to add the necessary dataTables components to your header script
Edited by admin Removed - the post here was advertising a commercial piece of software for .NET's DataTable class, not for the DataTables Javascript library, therefore it was not applicable and has been removed as advertising.