public ActionResult Index(int page = 1) { ViewBag.listLoaiSanPham = _lspService.LayTatCa(); int pageSize = 10; int totalRow = 0; var list = _spService.LayTatCaPhanTrang(page, pageSize, out totalRow); int totalPage = (int)Math.Ceiling((double)totalRow / pageSize); var paginationSet = new PaginationSet <SanPham>() { Items = list, MaxPage = 5, PageIndex = page, TotalCount = totalRow, TotalPages = totalPage, Count = list.Count() }; return(View("Index", paginationSet)); }