开发者

Pagination In MVC [duplicate]

This question already has answers here: Closed 12 years ago.

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));
   }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜