Click here to Skip to main content
16,018,318 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi.
I have an update panel which contains a datalist control There are some labels inside the Item Template of this datalist.
Following is what I need to do:
Initially datalist will show top 50 rows from the database.
When I click on load more button, there will be a partial postback which will fetch 50 more rows from the database.
Now, one approach that I have used earlier is to fetch (old rows + new 50) and re-assign this new datatable to the datalist.
However, this strategy has a problem. When too many data times are required, fetching all of them again and again creates load on server.
So what I want is that: On load more button click, only new 50 rows should be fetched. Old data should remain intact inside datalist and the new data should be appended to the datalist.

What I have tried:

Donot know how to do this approach.
Posted
Updated 6-Oct-16 23:42pm
v2

1 solution

First off, don't use UpdatePanel to do this. You can instead use AJAX to load the next result set on the page. You can apply the concept of "infinite scroll" to load the rest of the data while you scroll or click on the more button.

Take a look at this for example: http://www.aspsnippets.com/Articles/Load-data-while-Scrolling-Page-down-with-jQuery-AJAX-and-ASPNet.aspx[^]

Just do a quick search in google to find more examples in the web.
 
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