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

Updating control via AjaxRequest using Proxy

1 Answer 270 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jafin
Top achievements
Rank 2
Jafin asked on 27 Dec 2007, 08:46 AM
I have a typical Masterpage/content page scenario.
I have the following code setup where I am executing a AjaxRequest and wish to them update the RadGrid Control.  The documentation says that when this occurs to setup the AjaxManager as the calling control.

In this case I am using a proxy so I am substituing it here instead of the master page AjaxManager.  But it doesn't appear to trigger an update of the grid.

If I hard code the MasterPage's AjaxManager control Id in then it works.  The thing that is bugging me is I should not need to know the name of the control in the master, what happens if it changes?  Is there a way to not tightly couple the controlId to the masterPage and use the proxy controlId instead?



<telerik:RadCodeBlock>
<script type="text/javascript">
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
ajaxManager.AjaxRequest(args);
</script>
</telerik:RadCodeBlock>

<asp:ScriptManagerProxy runat="server" ID="uxScriptManagerProxy"></asp:ScriptManagerProxy>
<telerik:RadAjaxManagerProxy ID="uxRadAjaxManagerProxy" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="uxTasksRadGrid">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="uxTasksRadGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
               </UpdatedControls>
           </telerik:AjaxSetting>

      <telerik:AjaxSetting AjaxControlID="uxRadAjaxManagerProxy">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="uxTasksRadGrid" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
         </UpdatedControls>
      </telerik:AjaxSetting>

       </AjaxSettings>
   </telerik:RadAjaxManagerProxy>



(I also tried setting the ID="<%= RadAjaxManager.GetCurrent(Page).ClientID %> but that didn't appear to work either)

Any help appreciated!.


1 Answer, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 28 Dec 2007, 08:21 AM
Hello Jafin,

Does the master AjaxManager contain a setting as the initiator being itself and the updated control being the grid? This is needed since you are actually performing a custom ajax request on the master manager, not the proxy manager. The following line obtains the instance to the master manager and performs an ajax request.

var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); 
ajaxManager.AjaxRequest(args); 

If the master manager contains the appropriate setting it will update the grid control.

Hope this helps!

Best wishes,
Vladimir Milev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Jafin
Top achievements
Rank 2
Answers by
Vladimir Milev
Telerik team
Share this question
or