The controls in Telerik RadAjax suite can be used in various scenarios with MasterPage. However you should have in mind that you cannot have two AJAX Managers in a single INamingContainer, yet you can still put instances in different containers (content pages). In case of using AJAX Panel you have no limitations and you can wrap a whole content page or the master page content in a panel.
You can use RadAjaxManager instances in MasterPage and in any ContentPage. Unfortunately not all possible scenarios can be handled when using RadAjaxManager in content pages - in this case a control in the master page cannot be ajaxified. RadAjaxManager can handle only the cases when the controls to ajaxify are beneath in the control hierarchy.
A better approach that we highly recommend is to place the AJAX Manager in your MasterPage. Then the mager will be responsible for updating all the content in the content page as well as the MasterPage controls. Same is valid for AjaxLoadingPanel, which can be used for all defined AjaxSettings.
 |
You cannot define the necessary AjaxSettings through RadAjaxManager designer because the designer cannot localize controls within ContentPlaceHolder. These should be added in the code-behind for the Master or Content page. |
RadAjax controls should 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. You may refer to the following forum thread from telerik asp-net-community where this approach is discussed (see Robert's code-snippet):
http://www.telerik.com/asp-net-community/forums/forum-thread.aspx?b311D=ebgbb
A live example with Telerik RadAjax and MasterPage can be found here:
http://www.telerik.com/demos/aspnet/Ajax/Examples/ASPNET20/MasterPage/DefaultCS.aspx
The MasterPage code-behind is available in your installation folder:
C:\Program Files\Telerik\RadControlsQ2 2008\NET2\Ajax\Examples\ASPNET20\MasterPage
or at
C:\Program Files\Telerik\Telerik RadAjax1.7\NET2\Ajax\Examples\ASPNET20\MasterPage
if you have installed Telerik RadAjax only.
See Also