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

user control delay load

3 Answers 165 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 17 Apr 2009, 08:52 PM
Hi, I'm working on a Portal implementation. We have a initial page (inside a master) and we need to dinamically load several user controls (widgets).  Now we are loading this controls inside RadDocks (It's working fine, but takes to much time loading the contents of the UC).  We need to load the page first, show the update loading panel (for each widget), and then initiate the call to the user controls (like igoogle). Is there any way to acomplish this?  Thanks in advance!  

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Apr 2009, 03:09 PM
Hello Jorge,

You can ajaxify an ASP.NET Panel which will hold the User Control. For instance, you can use a button as initiator of an Ajax request and update the Panel with the RadAjaxManager. In this scenario, until the user control is loaded, the RadAjaxLoadingPanel will be shown. Here is a code snippet explaining the suggested scenario:
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  
        height="75px" width="75px">
        <img alt="Loading..."  
            src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'  
            style="border:0px;" /> 
    </telerik:RadAjaxLoadingPanel> 
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnDynamicIncludeUC"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="PlaceHolder1" LoadingPanelID="RadAjaxLoadingPanel1"/> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <asp:Button id="btnDynamicIncludeUC" runat="server" Text="Add UC"  
        onclick="btnDynamicIncludeUC_Click" /> 
    <br /> 
    <asp:Panel ID="PlaceHolder1" runat="server"
    </asp:Panel 
Thus when the user clicks the btnDynamicIncludeUC, the RadAjaxLoadingPanel will show itself until the user control is loaded in the ASP.NET Panel.

You can also show and hide the RadAjaxLoadingPanel explicitly using the client API. For further information you can refer to this online help article.

Best wishes,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Greg Mattison
Top achievements
Rank 2
answered on 30 Apr 2009, 06:53 PM
I'm actually trying to do the exact same thing, and haven't found a good solution yet. 

I don't want a button to control the loading of the widgets.  I want them to load on their own after the page with the placeholders is done loading on the browser.

I've been looking at the panel postback options, but, when i try to call a function on onload, AjaxRequestWithTarget doesn't want to work.

But, i think the solution does indeed lie with AjaxRequestWithTarget...
0
Sebastian
Telerik team
answered on 04 May 2009, 11:56 AM
Hello Greg,

You may consider initiating ajax request using the ajaxRequest(args) client method of the manager (with setTimeout if necessary) to perform additional ajax request and load the widgets inside the OnAjaxRequest server handler. For this purpose you need to set the ajax manager as an initiator and the widgets as updated controls through RadAjaxManager setting.

I hope this is feasible solution for your configuration.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Jorge
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Greg Mattison
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or