开发者

How to incrementally load an asp.net page having a Repeater control?

开发者 https://www.devze.com 2023-03-13 02:04 出处:网络
I have a page that shows results of a query. The results are displayed using a Repeater control that emits a div element that holds text data and images related to that particular result. The problem

I have a page that shows results of a query. The results are displayed using a Repeater control that emits a div element that holds text data and images related to that particular result. The problem is that the page takes considerable amount of time to load partly because of the huge amount of processing required to generate the data.

So, is there a way to improve the page load by 开发者_Python百科incrementally rendering the page rather than the have the user wait until the full data is available

I was thinking about sending the text data of each result first, and then as the images are available, send them to client to be displayed with each result. I guess I will need to use AJAX, but I'm not exactly sure how to get this done.

Does anyone have any suggestions or experience with this situation?

Thanks,


If you are going to control the flow, you can set up flushing on the binding event so the data is flushed out prior to having everything. But that may not be the best option; and, with standard tagged documents (rather than CSS docs) it might not help anyway, as the browser may not render even when flushed (depends on the tags in the Repeater).

Another option is retrieving via AJAX and flusing as data comes in (or at least showing a "wait for it" graphic). The wait graphic can be done without AJAX, but the load with AJAX pattern is well documented.

You can also limit the amount of data on a single page, unless this is a report of some type.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号