public ActionResult Grid() { var items = Mapper.Map <IEnumerable <ApplicationUser>, IEnumerable <UserViewModel> >(context.Users); var grid = new UserAjaxPagingGrid(items, 1, false); return(PartialView("_UserGrid", grid)); }
public JsonResult GetUserList(int page) { var items = Mapper.Map <IEnumerable <ApplicationUser>, IEnumerable <UserViewModel> >(context.Users); var grid = new UserAjaxPagingGrid(items, page, true); return(Json(new { Html = RenderPartialViewToString("_UserGrid", grid), HasItems = grid.DisplayingItemsCount >= grid.Pager.PageSize }, JsonRequestBehavior.AllowGet)); }