javascriptasp.netasp.net-ajaxupdatepanel

How to fire an UpdatePanel after the page load is complete


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?

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.


Solution

  • Use a timer control that will be fired after a certain number of milliseconds (for page to load). In the timer tick event refresh the update panel.