public ActionResult Page(int PageNumber, int PageSize) { ViewBag.PageNumber = PageNumber; ViewBag.PageSize = PageSize; List <ProductBLL> Model = new List <ProductBLL>(); try { using (ContextBll ctx = new ContextBll()) { ViewBag.TotalCount = ctx.ObtainProductCount(); Model = ctx.GetProducts(PageNumber * PageSize, PageSize); } return(View("Index", Model)); } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } }