Telerik UI for ASP.NET AJAX

The controls in Telerik RadAjax suite can be used in various scenarios with MasterPage. However, one should have in mind that she cannot have two RadAjaxManagers in master and content page at the same time. Instead, since May 2007 release of , RadAjaxManagerProxy control can be added and configured design-time the same way as the manager.

Of course, one can add RadAjaxManager control in any ContentPage. Unfortunately not all possible scenarios can be handled when using RadAjaxManager this way - for example a control in the master page cannot be ajaxified. RadAjaxManager can handle only cases when there controls to ajaxify are beneath in the manager control hierarchy, so we strongly recommend placing RadAjaxManager in MasterPage and adding proxy controls in content pages.

Find below a RadAjaxManagerProxy within a content page example:

CopyASPX
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" 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>

Note

RadAjaxManagerProxy control can be used for design-time configuration only. It does not have a client-side object or methods!

Note

Should you need the server or client-side RadAjaxManager functionality (like ResponseScripts collection, ajaxRequest function) you can get the "master" manager instance via Server-SideGetCurrent method from the ContentPage code-behind:

RadAjaxManager.GetCurrent(Page)

Use server-side code block in your javascript function to call the master manager AjaxRequest function from the ContentPage as well:

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

As to the AJAX settings, they still can be added programmatically - RadAjax controls can be accessed at ContentPage's code-behind using FindControl method of MasterPage object. However, in case you use a lot of ContentPages, you should write the same "finding" code in all the places. A better approach is to set the Manager (and the Loading Panel if used) as a property and access it directly.

A live example with RadAjax and MasterPage can be found here.

See Also