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

PanelBar, UserControls & RadAjaxManager

1 Answer 50 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 30 Jan 2009, 09:03 PM
I have two usercontrols which contained RadAjaxManagerProxy's to handle page updates. These controls where both loaded independently within an aspx page which contained it's own RadAjaxManager. Everything seemd to play along nicely and my 

RadAjaxLoadingPanel

images displayed as the page data was being updated within these usercontrols.

Recently I created a new usercontrol which contained nothing but a RadPanelBar and within that it contained two panel items. Each of the panel items contained one of the usercontrols mentioned above. Essentially this new control became a wrapper for the previous two controls to be included within a panel bar.

The problem I am having however is that the loading panel images do not appear to be getting triggered as it was before. The documentaion is a little sparse on this topic.

Here is a snippet sample of my code:

Main .aspx

....  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnRun">  
                <UpdatedControls> 
                   ....  
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">  
        ...  
    </telerik:RadAjaxLoadingPanel> 
 
<uc1:MyControl ID="MainControl" runat="server" /> 
... 

Main usercontrol.ascx

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">      
</telerik:RadAjaxManagerProxy> 
<telerik:RadPanelBar Skin="Gray" ID="RadPanelBar1" runat="server" AllowCollapseAllItems="true" 
    ExpandMode="SingleExpandedItem" EnableViewState="true" Width="100%">  
    <Items> 
        <telerik:RadPanelItem Text="Panel 1" runat="server" 
            Value="1">  
            <Items> 
                <telerik:RadPanelItem runat="server">  
                    <ItemTemplate> 
                        <us1:MyControl1 runat="server" ID="Control_1" /> 
                    </ItemTemplate> 
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem Text="Panel 2" runat="server" Value="2">  
            <Items> 
                <telerik:RadPanelItem runat="server">  
                    <ItemTemplate> 
                        <uc1:MyControl2 runat="server" ID="Control_2" /> 
                    </ItemTemplate> 
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelItem> 
    </Items> 
    <CollapseAnimation Duration="100" Type="InOutBounce" /> 
    <ExpandAnimation Duration="100" Type="InOutBounce" /> 
</telerik:RadPanelBar> 
 

Control1.ascx (Control2.ascx is similar)

....  
 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
    <AjaxSettings> 
        ....<list removed for space> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel99" runat="server">  
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px; position: relative; top: 75px;" /> 
</telerik:RadAjaxLoadingPanel> 
 
.... remaining page with controls .... 

I hope this makes sense. Bottom line question is how can I continue to get the loading panel images to work in this configuration.

Thanks!!

Paul
 

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 02 Feb 2009, 05:59 PM
Hello Paul,

I assume that the all controls, which are ajaxified, work  properly, but the loading image is not shown. My suggestion is to wrap the user controls in DIV mark-up code. Otherwise all asp controls in the user control will be placed in the Main page, and thus the Ajax manager does not know which asp controls are part of the first User control, and which from the second one.

To implement the suggested approach refer to the code below:
    protected override void Render(HtmlTextWriter writer) 
    { 
        writer.Write(String.Format("<div id={0}>"this.ClientID)); 
        base.Render(writer); 
        writer.Write("</div>"); 
    } 

This code should be used in every of your user controls.

If the problem persists, feel free to open a support thread and send us a working test project which reproduces this abnormality. Thus I will do my best to help you further.

Best,
Georgi Krustev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Paul
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or