I'm working on it right now. I am using ASP.Net MVC 2 web application using religious data tables and you need to show over 1000 records in each table. Server-side processing is the way for me. Here is what we have.
Here is our ad in view (/ Admin / Unassigned).
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#adminUnassignedTable').dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "/Admin/UnassignedTable" }); }); </script>
Here is our controller function (/ Admin / UnassignedTable).
public void UnassignedTable() { statusID = (int)PTA.Helpers.Constants.Queue; locationID = (int)PTA.Helpers.Constants.Reviewer; _AdminList = PTA.Models.IPBRepository.GetIPBsByStatus(Convert.ToInt32(statusID), Convert.ToInt32(locationID)); //_AdminList is an IEnumerable<IPB>, IPB being our class IEnumerable<IPB> _NewList; int nDisplayStart = Convert.ToInt32(HttpContext.Request.QueryString.Get("iDisplayStart"); int nDisplayLength = Convert.ToInt32(HttpContext.Request.QueryString.Get("iDisplayLength"); _NewList = _AdminList.Skip<IPB>(nDisplayStart).Take<IPB>(nDisplayLength).ToList<IPB>(); string strOutput = "{"; strOutput += "\"sEcho\":" + HttpContext.Request.QueryString.Get("sEcho") + ", "; strOutput += "\"iTotalRecords\":" + _AdminList.Count().ToString() + ", "; strOutput += "\"iTotalDisplayRecords\":" + _AdminList.Count().ToString() + ", "; strOutput += "\"aaData\":["; foreach (IPB ipb in _NewList) { strOutput += "[ "; strOutput += "\"" + ipb.IPBName + "\","; strOutput += "\"" + ipb.PubDate + "\","; strOutput += "\"" + ipb.Change + "\","; strOutput += "\"" + ipb.ChangeDate + "\","; strOutput += "\"" + ipb.TotalParts + "\","; strOutput += "\"" + ipb.TotalPartsReports + "\","; strOutput += "\"" + ipb.ALC + "\","; strOutput += "\"" + ipb.DateAdded + "\","; strOutput += "\"" + "" + "\","; //Need to add drop down control, that why it blank. strOutput += "\"" + "" + "\","; //Need to add drop down control, that why it blank. strOutput += "\"" + "" + "\","; //Need to add drop down control, that why it blank. strOutput += "\"" + "" + "\""; //Need to add drop down control, that why it blank. strOutput += "]"; if (ipb != _NewList.Last()) { strOutput += ", "; } } strOutput += "]}"; Response.Write(strOutput); }
Note!!!!!!! When adding a control, you must put your quotation marks for your control values ββas \\ "because the backslash must be in the JSON data.
We hope that in the controller you can access your web service. I am not very familiar with web programming, so I donβt know what you need to do. I just thought that would help.