前台向后台发送的参数
search=false
nd=
rows,page,sidx,sord
后台要向前台发送的参数
page,total,records,rows
public ActionResult GetGratherTaskData(int rows,int page) { var dt = MaterialGatherService.GetMaterialGatherTaskData(); int count = dt.Count(); int total_pages = 0; if (count > 0) { total_pages = (int)System.Math.Ceiling((double)count / (double)rows); } else { total_pages = 0; } if (page > total_pages) page = total_pages; var data = new { total = total_pages, page = page, records = count, rows = dt.Skip(page - 1).Take(rows) }; return Json(data, JsonRequestBehavior.AllowGet); }