PagedList.Mvc is used for pagination of the records in Mvc application.So here I’m not going to explain about how to use it instead I want to specify one important tip which  comes into play when using this.

PagedListPager() method can call to the HttpGET method to perform whatever is the logic but when we want the PagedListPager method  to call to a HttpPost method then that doesn’t work.

Today I was learning about it and encountered this behavior.Below is the abstract code sample that demonstrate the point that PageListPager will not call the HttpPost method.

 
public class HomeController:Controller
{
[HttpPost]
public void showMethod(int arg)
{
//performs some processing here.
}
}

Below is the abstract code sample of the View

@Html.PagedListPager(Model, new{ id= Model.id}

Advertisements