I have one view that displays 3 different tables. So I am using PagedList for pagination. How can I rewrite my GetProduct method to go to the next page of a table when I click either page number or >> ?
Part of the cshtml related to PagedList
@Html.PagedListPager(Model.Products, page => Url.Action("GetNextProductPage", new { page }))
and the action,
public ActionResult GetNextProductPage(int?page)
{
var p=database.GetProducts().ToPagedList(page,10);
return View("CurrentPage",p);
}
The method will update the current page and so it adds view onto view...
Also, how could I return either a string or Json with GetNextProductPage while still able to use PagedList?