RadAjaxManagerProxy in User Control

3 posts, 0 answers
  1. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 28 Sep 2008 Link to this post

    I have a page with multiple usercontrols. I am using RadAjaxManagerProxy to add controls in the user controls with one RadAjaxManager on the main page.

    To update usercontrols from other usercontrols I am sending commands to the RadAjaxManager via javascript functions such as

    function

    ajaxMngrRequest(args){var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.ajaxRequest(args);
    }

    which then finds the controls and updates them. If I add the controls to be updated in the RadAjaxManagerProxy on the .ascx this all works fine.

    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ProdItemList" />
                    <telerik:AjaxUpdatedControl ControlID="lblOrderItems" />
                    <telerik:AjaxUpdatedControl ControlID="BtnSubmitItemOrder" />
                </UpdatedControls>
            </telerik:AjaxSetting>


    RadAjaxManager1 is on the main page with the updated controls in the usercontrol.

    The problem is I have one usercontrol with 2 placeholders containing datalists that are shown at different times, and not together, and if I add both to the update controls I get an error that it cannot find the one that is hidden.

    What it seems I must do is only add the controls to the RadAjaxManagerProxy in the ascx.cs so that only the controls that are visible. But I cannot seem to get this to work. Here is what I have tried

    AjaxManagerProxy1.AjaxSettings.AddAjaxSetting(ProdItemList, ProdItemList);

    and 

    AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("RadAjaxManager1");
    ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
    RadAjaxManagerProxy1.AjaxSettings.Add(ajaxSetting);

    I have also tried adding it to the AjaxManager on the main page like

    AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("RadAjaxManager1");
    ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
    RadAjaxManager.GetCurrent(Page).AjaxSettings.Add(ajaxSetting);

    I tried just adding controls to the RadAjaxManagerProxy that are just in the usercontrol.

    AjaxSetting ajaxSetting = new Telerik.Web.UI.AjaxSetting("ProdItemList");
    ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl("ProdItemList", "RadAjaxLoadingPanel1"));
    RadAjaxManagerProxy1.AjaxSettings.Add(ajaxSetting);

    Is it possible to add controls to the RadAjaxManagerProxy in the code behind of a user control?

    Thanks,
    Dave

  2. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 29 Sep 2008 Link to this post

    Adding it to the AjaxManagerProxy in the user control on page load like this  does work. When I tried it first I had another issue that was causing the problem.

    AjaxSetting

    ajaxSetting = new Telerik.Web.UI.AjaxSetting("RadAjaxManager1");

    ajaxSetting.UpdatedControls.Add(

    new AjaxUpdatedControl("ProductList", "RadAjaxLoadingPanel1"));

    AjaxManagerProxy1.AjaxSettings.Add(ajaxSetting);

    I hope this may help someone else.

    Regards,
    Dave

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Taormino
    Paul Taormino avatar
    4 posts
    Member since:
    Sep 2005

    Posted 05 Feb 2009 Link to this post

    Dave,

    It helped me immensely.  Thanks,

    Paul
Back to Top