Bipn Paul
Bipn Paul

Reputation: 1475

How to add page list in asp.net core MVC application?

I want to add page list in asp.net core MVC application so only 10 result will appear in the first page, to see more result I wanna add next option .I searched but didn't found any solution for this operation. There is NuGet package for asp.net but not for asp.net core application.

PagedList

X.PagedList (This is forked from PageList)

Upvotes: 0

Views: 3477

Answers (2)

Andrew S
Andrew S

Reputation: 561

If you'd rather not use jQuery and a bunch of UI-layer scripts that users will be able to read, you can modify your controller and actions to use pagination.

See the link below for a tutorial on adding Sorting, Filtering and Paging to a list view.

https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/sort-filter-page

I'm using this in a company project, and while it can be a bit cumbersome at first, once you get the hang of it it's easy to replicate the functionality in other pages.

Upvotes: 2

AkashR
AkashR

Reputation: 1

Use jquery datatable plugin to show data. On pagination button click make ajax call to server method to retrive next data. You can use datatable server side by setting server attribute to true. Please refer below links.

https://datatables.net/examples/data_sources/server_side.html

https://www.codeproject.com/Tips/1011531/Using-jQuery-DataTables-with-Server-Side-Processin

Upvotes: 0

Related Questions