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

User Controls - Master pages

First NameLast NameTitleBirth DateCityCountry
12
 Page 1 of 2, items 1 to 5 of 9.
NancyDavolioSales Representative12/08/1948SeattleUSA
AndrewFullerVice President, Sales02/19/1952TacomaUSA
JanetLeverlingSales Representative08/30/1963KirklandUSA
MargaretPeacockSales Representative09/19/1937RedmondUSA
StevenBuchananSales Manager03/04/1955LondonUK
  • Sales
  • Contact Information
 CustomerOrderIDOrder dateOrder Total
  Orders count: 108Last order dates: 5/5/1998 
Page size:
 108 items in 16 pages
Königlich Essen1032510/09/1996$1,319.40
Bon app'1034010/29/1996$128.22
Ernst Handel1035111/11/1996$378.98
LILA-Supermercado1035711/19/1996$441.92
QUICK-Stop1036111/22/1996$227.36
La maison d'Asie1037112/03/1996$18.24
Mère Paillarde1037612/09/1996$21.00
Customer Image
BirthDate:12/08/1948
Country:USA
City:Seattle
Address:507 - 20th Ave. E. Apt. 2A
HomePhone:(206) 555-9857

The example demonstrates how to use the RadAjaxManager control in a page->user control scenario. You can use the same approach in a master->content page scenario.

The standard controls from this demo (RadTabStrip, RadMultiPage, DetailsView, RadGrids and controls inside them) reside within a WebUserControl and the manager is placed in the main page (Telerik support always recommends that). You can apply exactly the same technique when the updated controls are hosted in a content page and the RadAjaxManager is added on the relevant master page.

< telerik:RadAjaxManagerProxy ID = "AjaxManagerProxy1" runat = "server" >
     < AjaxSettings >
         < telerik:AjaxSetting AjaxControlID = "EmployeesGrid" >
             < UpdatedControls >
                 < telerik:AjaxUpdatedControl ControlID = "RadTabStrip1" />
                 < telerik:AjaxUpdatedControl ControlID = "RadMultiPage1" LoadingPanelID = "RadAjaxLoadingPanel1" />
                 < telerik:AjaxUpdatedControl ControlID = "EmployeesGrid" />
             </ UpdatedControls >
         </ telerik:AjaxSetting >
         < telerik:AjaxSetting AjaxControlID = "OrdersGrid" >
             < UpdatedControls >
                 < telerik:AjaxUpdatedControl ControlID = "OrdersGrid" />
             </ UpdatedControls >
         </ telerik:AjaxSetting >
     </ AjaxSettings >
</ telerik:RadAjaxManagerProxy >

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 user control code-behind:

RadAjaxManager.GetCurrent( this ).Alert( "1" );

Use server-side code block in a JS function inside your WebUserControl to call the master manager ajaxRequest function:

<telerik:RadCodeBlock ID= "RadCodeBlock1" runat= "server" >
     <script type= "text/javascript" >
         function myUserControlClickHandler()
         {
             $find( "<%= RadAjaxManager.GetCurrent(this).ClientID %>" ).ajaxRequest( "content" );
         }
     </script>
</telerik:RadCodeBlock>
  • DefaultCS.aspx
  • WebUserControlCS.ascx
  • DefaultCS.aspx.cs
    • DefaultCS.aspx.cs
    • WebUserControlCS.ascx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.AjaxManager.ApplicationScenarios.UserControl.DefaultCS" %>

<%@ Register Src="WebUserControlCS.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <uc1:WebUserControl ID="WebUserControl1" runat="server"></uc1:WebUserControl>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance