views:

49

answers:

1

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??

A: 

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));
   }
ŁukaszW.pl