Pagination In MVC [duplicate]
Possible Duplicate:
How do I do pagination in ASP.NET MVC?
Hii,
I want to add pagination to my view .
i am getting data from model as a list of users in the controller .
and in view i am displaying that from Model by inheriting IEnumarable..now
How can i开发者_开发技巧 inherit IPagelist overhere?
can anyone help me??
What about passing the page number as an id to your Index action? For example:
public ActionResult Index(int id)
{
var query = from x in y
select x;
return View(query.Skip(id * 20).Take(20));
}
精彩评论