What is the benefits of using ServerSide Processing with JQuery Datatable?.
I personally found two important benefits of using ServerSide Processing with Datatable.
- We can handle more data using JQuery Datatable.
- Data can load quickly from the Database server .
Follow the following steps to use ServerSide processing with Datatable.
Step 1
Add JQuery Js file ,and Jquery Datatable css and Js file as shown in the below figure.

Add the following script to your .aspx page.
- <!-- DataTables CSS -->
- <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
- <!—jQuery Js -->
- <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"></script>
- <!-- DataTables JQuery file-->
- <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
Step 2
Create one WebService to Getdata (Here I am using asp.net WebService to get data). You can see my Solution Explorer . I have two web pages and one service, and the name of the service is webService.asmx.

Step 3
Create method inside service which will return data to bind Jquery Datatable.
- [WebMethod]
- public void HelloWorld()
- {
- List<MyClass> lst = new List<MyClass>();
- int i = 0;
- while (i < 10000)
- {
- lst.Add(new MyClass() { Empid = "1", Name = "Ar"});
- lst.Add(new MyClass() { Empid = "2", Name = "Br" });
- lst.Add(new MyClass() { Empid = "3", Name = "Cr" });
- i = i + 1;
- }
- var mydata=new DataTable()
- {
- aaData=lst,iTotalDisplayRecords=lst.Count,iTotalRecords=lst.Count
- };
- JavaScriptSerializer js=new JavaScriptSerializer();
- js.MaxJsonLength = int.MaxValue;
- Context.Response.Write(js.Serialize(mydata));
- }

Nilesh PatilPosted Oct 30, 2017, 8:52 AM
Nice article sir.........