Load page and THEN dynamically load content

4 posts, 0 answers
  1. Tobzi
    Tobzi avatar
    2 posts
    Member since:
    Jul 2009

    Posted 04 Jan 2011 Link to this post


    I'm keen on using the RAD controls since they totally rock, but I've got some issues with getting my head wrapped around something..

    This is how I want to use it/do:

    Get the page to load, have an updatepanel (or whatever RAD control needed for that) load the content of that panel asynchronously after the page is loaded.

    Right now if I hook up a RadRotator for example, and an XmlDataSource to that - it takes ages to load and THEN displays the webpage and releases the main UI thread.

    So, what I want to do is to load the page and have an update panel async load it's own content just like if you were clicking a button in that updatepanel, but on page load.

    To answer a few of your initial questions:
    * No, this doesn't apply to only the RadRotator, I know about the Load On Demand functionality. 
    * I want to do this for all my pages/applications I create - namely dynamically load the content and displaying a small "loading" gif while it's working. Basically just async loading with an indicator.

    Any push in the right direction would rock!

  2. Jeff P
    Jeff P avatar
    37 posts
    Member since:
    Mar 2007

    Posted 04 Jan 2011 Link to this post

    It has been my experience that using a timer control to initiate the load of the content after the page loads works well.  In the tick event, disable the timer as your first line, then call whatever load subroutines you need.  I also suggest using the Rad Ajax Manager to handle the AJAX requests.  
  3. DevCraft R3 2016 release webinar banner
  4. Tobzi
    Tobzi avatar
    2 posts
    Member since:
    Jul 2009

    Posted 05 Jan 2011 Link to this post


    This is what I've done in the OOTB controls from Microsoft (i.e. the Timer control to fill an UpdatePanel with data).
    However it's not working the way I'd expect it to, so I tried these controls out.

    Unfortunately I'm seeing the very same result - that is, script errors saying something in the lines of the script generated being infinite and what not (the timer is disabled by that point, it executes once only).

    It works with most controls as you describe it, but for the RAD Rotator it didn't work to call an external data source (XmlDataSource), as it then freaks out with that error. Might need to do some oldschool async fetch on that
  5. Pero
    Pero avatar
    1156 posts

    Posted 10 Jan 2011 Link to this post

    Hi Tobzi,

    You could try the following approach for the RadRotator control:
    • Replace the UpdatePanel that wraps the rotator with AjaxPanel
    • Handle the load client-side event (OnClientLoad property) of the RadRotator, and initiate an Ajax Request using JavaScript with a small timeout to populate the control.
    • Remove the handler from the OnClientLoad property on the server during the Ajax postback, to avoid recursion.
    For the other controls you should use the the application load method, i.e. pageLoad or the load client-side events of the other controls.

    Please send us some sample code that demonstrates the JavaScript errors thrown, so we can debug them locally.

    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top