RadAjax for ASP.NET AJAX

RadControls for ASP.NET AJAX

RadAjax no longer allows more than one RadAjaxManager on the page. Instead, in a complex scenario like WebUserControls or Master/ContentPages, one should place RadAjaxManager instance on the main/master page and add a proxy control to the user control/content page. RadAjaxManagerProxy copies the exact same RadAjaxManager designer configuration so that one can set all the necessary AJAX settings within the WebUserControl/ContentPage entirely through the designer.

CopyASPX
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="DropDownList1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
                <telerik:AjaxUpdatedControl ControlID="GridView1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="GridView1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="GridView1" />
                <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

The purpose of the new control is to ease the design-time configuration only. The Proxy does not provide client-side functionality as the Manager does. There is no client-side object as well as functions like ajaxRequest/ajaxRequestWithTarget and client-side events. Instead, one can get the Manager instance through the GetCurrent static method similar to the ASP:ScriptManager control and call the master manager client-side methods if necessary.

CopyASPX
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function myUserControlClickHandler() {
            $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content");
        }
    </script>
</telerik:RadCodeBlock>
Caution

When a server-side code block will be used one should wrap the entire script in a RadCodeBlock.

In case you need to handle the master manager events in the user control or content page, you can attach event handlers to the manager as follows:

Note

Should one need to add AJAX settings programmatically, it is recommended to get the master manager instance and call its methods/properties as well. The same GetCurrent method could be used to access the AJAX Manager placed in the Master/Main page from a Content page/WebUserControl.