Skip to content Skip to sidebar Skip to footer

Progress Bar While Page Performs Function Before It Posts Back

I'm not sure if this is possible. I'm trying to display a progress bar when an asp button has been clicked. The button will perform a lengthy database operation before posting back

Solution 1:

You can use UpdatePanel and UpdateProgress controls to do the task. Here is a example

Other solution. First create a WebService (which will do the required task), call it from client side on button click and at the same time using javascript or jquery show image. And as soon as you got confirmation from the service that task has been completed hide this image and tell user that task has been completed.

Solution 2:

Calculating the time a database operation takes, is usually a nontrivial task.

If the key point is not in providing user the accurate time, but just a notification that "something is being done", consider using an animated image (often called "ajax loader") that shows users that database operation is under progress:

enter image description here

You can easily customize and download an ajax loader image at http://ajaxload.info/

You can simply add the image as a hidden element in the page and show it when user triggers the database operation. For some detailed ideas, see question "display an ajax loader icon when submitting a form".

Post a Comment for "Progress Bar While Page Performs Function Before It Posts Back"