New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

RadAjax and MasterPage

The controls in Telerik RadAjax suite can be used in various scenarios with MasterPage. However, one should have in mind that they cannot have two RadAjaxManagers in master and content page at the same time. Instead, since the May 2007 release, 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 the 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:

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <telerik:AjaxSetting AjaxControlID="DropDownList1">
                <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
                <telerik:AjaxUpdatedControl ControlID="GridView1" />
        <telerik:AjaxSetting AjaxControlID="GridView1">
                <telerik:AjaxUpdatedControl ControlID="GridView1" />
                <telerik:AjaxUpdatedControl ControlID="DetailsView1" />

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

Should you need the server or client-side RadAjaxManager functionality (like ResponseScripts collection, ajaxRequest function) you can get the " master " manager instance via Server-Side GetCurrent 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:

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

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

In this article
Not finding the help you need? Improve this article