This is a migrated thread and some comments may be shown as answers.

Load page and THEN dynamically load content

3 Answers 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tobzi
Top achievements
Rank 1
Tobzi asked on 04 Jan 2011, 08:56 PM
Hi,

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!

Cheers,
Tobzi

3 Answers, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 2
answered on 05 Jan 2011, 01:54 AM
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.  
0
Tobzi
Top achievements
Rank 1
answered on 05 Jan 2011, 08:42 PM
Hi,

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
0
Pero
Telerik team
answered on 10 Jan 2011, 06:16 PM
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.

Regards,
Pero
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.
Tags
General Discussions
Asked by
Tobzi
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 2
Tobzi
Top achievements
Rank 1
Pero
Telerik team
Share this question
or