Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select

Ajax / User Controls/Master pages

First NameLast NameTitleBirth DateCityCountry
12
 Page 1 of 2, items 1 to 5 of 8.
AndrewFullerVice President, Sales02/19/1952TacomaUSA
JanetLeverlingSales Representative08/30/1963KirklandUSA
MargaretPeacockSales Representative09/19/1937RedmondUSA
StevenBuchananSales Manager03/04/1955LondonUK
MichaelSuyamaSales Representative07/02/1963LondonUK
 CustomerOrderIDOrder dateOrder Total
  Orders count: 0  
 
No records to display.
Customer Image
BirthDate:02/19/1952
Country:USA
City:Tacoma
Address:908 W. Capital Way
HomePhone:(206) 555-9482

  • The example demonstrates how RadAjaxManager control should be used in page->user control scenario. The same approach can be used in master->content page scenario.

    The standard controls from this demo (RadTabStrip, RadMultiPage, DetailsView, RadGrids and controls inside them) reside within a web user control and the manager is placed in the main page (we always recommend that). Exactly the same technique is applicable when the updated controls are hosted in a content page and the ajax manager is added on the relevant master page.

    With the help of the new ajaxifying that is completely codeless.

    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="EmployeesGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControls 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>


Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Ajax.UserControl.DefaultCS" %>

    <%@ Register Src="WebUserControlCS.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
        .contactWrap
        {
            padding:10px 15px 15px 15px;
            background:#fff;
            color:#333;
        }
        </style>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" XhtmlCompliant="true" ShowSkinChooser="true" />
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
            <uc1:WebUserControl ID="WebUserControl1" runat="server" />
            <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451