public ActionResult WebGrid(int page=1,string sort = "", string sortdir = "", string search = "") {
var list = new List<Product>(); int DisplayLength = 10; int DisplayStart = (page * DisplayLength) - DisplayLength; list = pad.GetPrdListInChunks_1(DisplayLength, DisplayStart, sort, sortdir); ViewBag.TotalRows = list[0].TotalCount; ViewBag.Search = search; return View(list);
var list = new List<Product>();
int DisplayLength = 10;
int DisplayStart = (page * DisplayLength) - DisplayLength;
list = pad.GetPrdListInChunks_1(DisplayLength, DisplayStart, sort, sortdir);
ViewBag.TotalRows = list[0].TotalCount;
ViewBag.Search = search;
return View(list);
}
@model List<NorthwindApplication.Models.Product>@{
Layout = "~/Views/Shared/_Layout.cshtml";WebGrid grid = new WebGrid(canPage: true, rowsPerPage: 10);grid.Bind(Model, rowCount: ViewBag.TotalRows, autoSortAndPage: false);
Layout = "~/Views/Shared/_Layout.cshtml";
WebGrid grid = new WebGrid(canPage: true, rowsPerPage: 10);
grid.Bind(Model, rowCount: ViewBag.TotalRows, autoSortAndPage: false);