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

RadAjaxLoadingPanel - work w/ UserControls?

3 Answers 207 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 18 Oct 2008, 01:53 AM
hello,

im noticing that when using a RadAjaxManager, my LoadingPanel doesnt show up when one of the updated-controls is a UserControl.

like so:

<table> 
    <tr> 
        <td class="label">Offender:</td> 
        <td> 
            <Telerik:RadComboBox ID="rcbOffenders" DataValueField="OffenderID" DataTextField="LastName" Skin="Gray" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rcbOffenders_SelectedIndexChanged" /> 
        </td> 
    </tr> 
</table><br /> 
 
<asp:HiddenField ID="hidPreviousOffenderID" runat="server" /> 
 
<Epr:OffenderDescriptions ID="ucOffenderDescriptions" OffenderSelected="ucOffenderDescriptions_OffenderSelected" runat="server" /> 
 
 
<Telerik:RadAjaxManager ID="radAjaxManager" runat="server"
    <AjaxSettings> 
        <%-- Offenders list updates usercontrol --%> 
        <Telerik:AjaxSetting AjaxControlID="rcbOffenders"
            <UpdatedControls> 
                <Telerik:AjaxUpdatedControl ControlID="hidPreviousOffenderID" LoadingPanelID="ajaxLoadingPanel2" /> 
                <Telerik:AjaxUpdatedControl ControlID="ucOffenderDescriptions" LoadingPanelID="ajaxLoadingPanel2" /> 
            </UpdatedControls> 
        </Telerik:AjaxSetting> 
    </AjaxSettings> 
</Telerik:RadAjaxManager> 
 
 
<Telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel2" Width="75px" Height="75px" Transparency="20" runat="server"
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> 
</Telerik:RadAjaxLoadingPanel> 


...telerik -- shouldnt the LoadingPanel show up?


thanks,
matt

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 20 Oct 2008, 06:53 AM
Hi matt,

UserControls does not render any HTML element and that is why the loading panel is not shown!

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve Keating
Top achievements
Rank 1
answered on 09 Jan 2009, 01:30 AM
Matt,

I had this problem in a 1 page application i'm developing.  If you want the User Controls to fire off the loading panel from the content / masterpage they are placed on do the following and it should solve the problem.  You will likely have to be using the RadAjaxManager control in order to obtain the specificity needed to be able to add AjaxSettings at runtime.

1) make sure the RadAjaxManager is exposed to the user control (I.E the user control can obtain a local reference to the AjaxManager) 

2) expose the loading panel to the user control as well.

3) add an ajaxsetting for whatever controls within the user control you want to trigger the loading panel. 

4) wrap the user controls in their own ASP Panel control.  This allows you to use the panel as the target of the update rather than a user control as RadAjaxManager cannot operate on objects of inherited type UserControl.

This should cause the loading panel to fire whenever the action is triggered in the User Control. 

example: (In page_load of the User Control)
<AjaxManager>.AjaxSettings.AddAjaxSetting(<control in UserControl triggering update>, <Panel wrapper for User Control being updated>, <LoadingPanel>)

This will also require you to expose the panel wrappers to the user control adding the ajax settings as well


Currently in my Application, I have controls within UserControls triggering updates of other UserControls (and controls within them) and the Loading Panels fire off prefectly both directions.

I'm not sure what your situation exactly is in terms of site design so I tried to make this pretty generic.  If you need more specific help, post and I'll see what I can do.

Thanks,
Steve Keating
0
Tharaka
Top achievements
Rank 1
answered on 21 Dec 2010, 07:30 AM
Hi Steve,
can you please upload the sample code related to your explanation.
 
Thanks,
Tharaka
Tags
Ajax
Asked by
matt
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Steve Keating
Top achievements
Rank 1
Tharaka
Top achievements
Rank 1
Share this question
or