[RESOLVED]fast paging for large numbers of data

which is the easy way to create fast paging for large amount of data more than 10 thousand

tried out ajax paging but taking too much time

nuget paged list fetch all the data which makes the site slow

now how to do the paging please suggest

plus it has a search form i want a paging which maintain search result for it

Hi,

For large amount of data, we need to make paging at the server side. You may see

http://www.asp.net/mvc/tutorials/getting-started-with-ef-5-using-mvc-4/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application.

It may help.

Have fun

How many records do you show in 1 page? You need to get only that many records from the DB. Refer below link for DB paging 

http://social.technet.microsoft.com/wiki/contents/articles/23811.paging-a-query-with-sql-server.aspx 

How many records retrieving from db

If you are getting all 10000 from db and handling front-end the here is my idea.

1. Define a store proc in the back to return only the specific page records and count variable

   search proc should have pagesize, pageindex, sort,sortdir, totalcount out and other search parameters

2. So you get only the particular page records from procedure with total_record_count as out

3. Map the page records (returned by store proc) to a model list

4. Send model list to web grid

5. Design asp.net mvc web grid with this result model list and use webgrid.bind method where you can total_record_count) to let the webgrid to render paging

Try DataTables JQuery control. This is free and has a option to fetch page by page using ajax. I used it earlier and worked well. Please see this blog for more information

jQuery
DataTables and ASP.NET
MVC
Integration – Part I

Leave a Reply