Gridview not updating on postback
The entire source code and mark up is as shown below: Well those were the three different methods of displaying progress to the user while the Update Panel updates its contents.The entire source code of this article can be downloaded from here (pwd:dotnetcurry123#).When the user initiates a postback by clicking on the button kept inside the Update Panel, we set a delay of 3 seconds.
For understanding purposes, we have emulated a time consuming operation by setting a delay of 3 seconds by using Thread. In the code shown above, we use the Associated Update Panel ID property of the Update Progress control to associate it with an Update Panel control.
Let us see how to use some events of this class to display progress to the user while the Update Panel updates its contents.
As shown in the code above, we first get a reference to the Page Request Manager and then wire up the initialize Request and end Request events to execute, when an async postback begins and ends respectively.
As shown in the previous methods, we have emulated a time consuming operation by setting a delay of 3 seconds by using Thread. You can replace this code with any time consuming operation, like fetching records from a remote database or performing any similar resource intensive operation.
The technique of hiding and showing the image also remains the same as we had discussed in Method 1.