views:

66

answers:

3

Hi folks
I want to implement the following page by Asp.net version 4.0 and ajax but I want to have loading by order like loading item 1 and 2 and so on. I have container or web part but mostly container like simple asp.net panel. how I can implement it ? I used updatepanel and update progress but it doesn't work that I have expected before.

alt text

A: 

You can use asp:timer ajax controls to initiate loading of all update panels after page skeleton loads. Have update panel 1 loaded after 1 ms of page load, panel 2 after 100ms, 3 after 200ms and so on. Because UpdatePanel control is synchronous they all will load up sequentially exactly how you want it.

Maciej
but timer can not understand updatepanel 1 is finished and it loads the content completely so how you can say loaded after 1ms load panel 2 how you can predict updatepanel 1 finished and going to update panel 2, Are they work simultaneously so what is the order meaning I said. I think good solution is to implement updatepanel class again or override add new event handeler such as UpdatePanel_LoadComplete but I don't know is it possible or not I just say it is not good way that using timer because you can not estimate when the load is complete
kamiar3001
That is true that you cannot know when first panel will finish updating but as I said update panel control is synchronous and no 2 update panels can update at the same time. I experienced it myself. If you try to update 2 panels at the same time they will update one by one. And that is the point - you can use this limitation to update series of panels one after another, sequentially rather than all at once. Timer delays are not that important. Actually you could try to update all panels in the first timer and you should achieve sequential update of all panels. Try it.
Maciej
A: 

Actually not totally true about the timer lapse being unimportant. If all timers fire at the same time for all the associated UpdatePanels, they would not just queue up and fire off one at a time. In fact, by default, when a page makes multiple asynchronous postbacks at the same time, the postback made most recently takes precedence. This will cancel all other asyncronous postabacks from UpdatePanels that have not yet been fired.

I agree the solution is to use AJAX Timers, but you will need to start the next timer upon completion of the previous UpdatePanel completing to load. I have implemented this myself with a combination of JavaScript and .NET server side code. The following link should help you accomplish this task:

Handling Multiple Asynchronous Postbacks: http://disturbedbuddha.wordpress.com/2007/12/12/handling-multiple-asynchronous-postbacks/

atconway
+1  A: 

Here is another helpful URL as well:

Giving Precedence to a Specific Asynchronous Postback: http://msdn.microsoft.com/en-us/library/bb386456.aspx

atconway