开发者

Pagination In MVC [duplicate]

开发者 https://www.devze.com 2023-01-11 11:28 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: How do I do pagination in ASP.NET MVC?
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

精彩评论

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