Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to do pagination and searching in a ienumerable list view
using mvc5
Posted

1 solution

On your IEnumerable collection you can use LINQ and do this.

C#
int pagesize = 10;
collection.Where(item => this.DoSearch(item)).Take(pagesize);


and you can define your search function as you like but it should return bool:

C#
public bool DoSearch()
{
    // put your search code here
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900