Last post Apr 27, 2016 08:09 AM by Khuram.Shahzad
Apr 27, 2016 07:20 AM|iamyae|LINK
I'm showing hundreds of list items in a asp.net 5 page.
I need to pagination the page so that it won't be too complicated to read.
But I didn't find an appropriate way.
Apr 27, 2016 07:39 AM|Das.Sandeep|LINK
Apr 27, 2016 08:09 AM|Khuram.Shahzad|LINK
There are several techniques to perform pagination.
1: if you are using stored procedures in your application either by Ado.Net or EF calling you can have a stored procedure which take page number and totalrecordstoreturn parameter and then return no of records accordingly sql server 2012 and onward support
offset and skip to manage this.
2: If you have data in cache you can use LINQ for pagination and you can take and skip what you want. like
var result = (from c in Customers
3: there are some grid view in MVC which take Enumerable or compatible and perform pagination for you like MvcGrid etc.
4: There is also a package available for pagination using nugget, you can install it and get IPagedList that do operations for you, several tutorials are available online.
Its depend on your scenario what you want.