RadAjaxLoadingPanel - work w/ UserControls?

4 posts, 1 answers
  1. matt
    matt avatar
    260 posts
    Member since:
    Oct 2007

    Posted 17 Oct 2008 Link to this post

    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
  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Oct 2008 Link to this post

    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.
  3. Steve Keating
    Steve Keating avatar
    11 posts
    Member since:
    Apr 2008

    Posted 08 Jan 2009 Link to this post

    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
  4. Tharaka
    Tharaka avatar
    1 posts
    Member since:
    Dec 2010

    Posted 21 Dec 2010 Link to this post

    Hi Steve,
    can you please upload the sample code related to your explanation.
     
    Thanks,
    Tharaka
Back to Top