开发者

AJAX: Statusbar: force update of UpdatePanel while function executes

开发者 https://www.devze.com 2022-12-30 06:58 出处:网络
I have a label inside an update panel which I would like to use as a status bar. Basically the user clicks a button which executes a main function that performs a series of tasks. I\'d like to inform

I have a label inside an update panel which I would like to use as a status bar.

Basically the user clicks a button which executes a main function that performs a series of tasks. I'd like to inform the user as to the state of the function as it progresses e.g.:

Stage 1: Retrieving data...

Stage 2: Calculating values...

Stage 3: Printing values...

Stage 4: Done!

I've tried updating the updatepanel directly from the function but it only updates the panel at the end of function (stage 4) and shows "Done!" (which I understand is how it should work).

I've been looking into timers and threads to try and update the panel separate to the main function but I though开发者_Python百科t I'd post here in case anyone has any better ideas?


Have you put an Update Panel around the label as well? Set UpdateMode to conditional, then when executing your stages, set the label's text then updatePanelProgress.Update() should do it

0

精彩评论

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

关注公众号