Reputation: 1195
I would like to be able to limit the number of rows that can be in table on View page (I am using ASP.NET MVC), and if there are more rows, it goes to the next page.
Upvotes: 2
Views: 2896
Reputation: 292475
Pretty simple :
var query = /* your Linq query */;
query = query.Skip(itemsPerPage * pageIndex).Take(itemsPerPage);
Upvotes: 5
Reputation: 36037
You will have a lot more luck finding the answer, if you say paging.
Asp.net mvc isn't like the regular asp.net, where you can get by without knowing a bit more of the underlying stuff.
Also note, that how exactly you implement paging in the controller & get the set of page links, depends on how you are getting a hold of your data.
Upvotes: 0