I'm sure this is easy but I can't figure it out:
I have an ASP.NET page with some UpdatePanels on it. I want the page to completely load with some 'Please wait' text in the UpdatePanels. Then once the page is completely loaded I want to call a code-behind function to update the UpdatePanel.
Any ideas as to what combination of Javascript and code-behind I need to implement this idea?
SAL
PS: I've tried putting my function call in the Page_Load but then code is run before the page is delivered and, as the function I want to run takes some time, the page simply takes too long to load up.
Best Answer
I fiddled around with the ScriptManager suggestions - which I reckon I would have eventually got working but it seems to me that the Timer idea is easier to implement and not really(!) that much of a hack?!
Here's how I got my panel updated after the initial page render was complete...
default.aspx
and the code behind default.aspx.cs reads
So, the page loads up and the Timer (contained within the UpdatePanel) fires 2 secs after the page has loaded up (I think - I'm not sure when the Timer actually starts?). The label text is rewritten and then the Timer is disabled to stop any more updates.
Simple enough - but can you purists out there tell me if this is a Horrible Hack?