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.

Search for gridview not updating on postback:

gridview not updating on postback-2gridview not updating on postback-45

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “gridview not updating on postback”

  1. Along with his new best friend, Muzaffar Lal, Kasab wandered from one temporary job to the next – washing plates in a restaurant, running errands for a guest house – but as the months drifted by, he realised his future was looking bleak.