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