public PartialViewResult Pending(int?PageNo) { System.Data.DataSet ds = lb.GetPendingApplications(GetEmpID()); PagedDataSet.PagedDataSet p1 = new PagedDataSet.PagedDataSet(); TempData["Page_App"] = "Pending"; if (PageNo.HasValue && PageNo.Value > 0) { ViewBag.PageNo = PageNo.Value; TempData["PageNo"] = PageNo.Value; System.Data.DataSet ds1 = p1.GetPage(ds, 5, PageNo); ViewBag.TotalPages = p1.GetTotalPages(); return(PartialView("Pending", ds1)); } else { ViewBag.PageNo = 1; TempData["PageNo"] = 1; System.Data.DataSet ds1 = p1.GetPage(ds, 5, 1); ViewBag.TotalPages = p1.GetTotalPages(); return(PartialView("Pending", ds1)); } }