Set RadTabStrip.MultiPageId to MultiPage on MasterPage

2 posts, 1 answers
  1. Thad
    Thad avatar
    106 posts
    Member since:
    Sep 2010

    Posted 17 Feb 2012 Link to this post


    Can I have a RadTabStrip inside of a ContentPlaceHolder that loads content into a RadMultiPage control that sits on the MasterPage?  Setting the radTabStrip.MultiPageID to either the ID or ClientID of the RadMultiPage still leaves radTab.MultiPage set to null so PageViews can not be added dynamically.

    More details:
    Our master page has a content place holder for tabs and we want to be able to have the RadMultiPage control on the MasterPage so that it can be shared by the half dozen user controls with RadTabStrip controls.  Also, we want to decouple the two controls so that the content loaded into the MultiPage can be positioned in the page flow wherever the designers feel it should sit.

    Piece of master page:
    <!-- holds the page banner -->
    <asp:Panel runat="server" ID="pnlBanner">
        <asp:ContentPlaceHolder ID="cphBannerContent" runat="server" />
    <!-- holds the tabstrip appropriate for the appropriate page -->
    <asp:Panel runat="server" ID="pnlTabs">
        <asp:ContentPlaceHolder ID="cphTabsContent" runat="server" />
    <div class="contentWidth">
        <!-- Content placed at the beginning of the page prior to any regular content-->
        <asp:Panel runat="server" ID="pnlPageHeader">
            <asp:ContentPlaceHolder ID="cphPageHeaderContent" runat="server" />
            <telerik:RadMultiPage ID="rmpMain" runat="server" SelectedIndex="0" />
        <!-- Master page automatically ajaxifies any content placed here -->
        <asp:Panel runat="server" ID="pnlAutoAjaxified">
            <asp:ContentPlaceHolder ID="cphAutoAjaxifiedContent" runat="server" />
        <!-- Any content placed here must be ajaxified by the page -->
        <asp:Panel runat="server" ID="pnlSelfAjaxified">
            <asp:ContentPlaceHolder ID="cphSelfAjaxifiedContent" runat="server" />

    On our page we have a RadTabStrip inside of the content placeholder "cphTabsContent" and dynamically load UserControls into each tab when clicked using code derived from the demo program.
    Here is the RadTabStrip on the demo page:
    <telerik:RadTabStrip ID="rtsDemo" runat="server" AutoPostBack="true" CausesValidation="false"
        Orientation="HorizontalTop" SelectedIndex="0">
            <telerik:RadTab NavigateUrl="" Text="Tab 1" ToolTip="Tab 1" Value="Tab1" />
            <telerik:RadTab NavigateUrl="" Text="Tab 2" ToolTip="Tab 2" Value="Tab2" />
            <telerik:RadTab NavigateUrl="" Text="Tab 3" ToolTip="Tab 3" Value="Tab3" />
            <telerik:RadTab NavigateUrl="" Text="Tab 4" ToolTip="Tab 4" Value="Tab4" />

    In the OnInit event I'm trying to set the MultiPageID of the RadTabStrip to the one on the MasterPage, but no matter what I do it doesn't work.
    rtsDemo.MultiPageID = "rtsMain"; // didn't work
    rtsDemo.MultiPageID = "ctl100_rtsMain"; // didn't work

    When we click on a tab, here is the code that runs:
    private void TabStrip_TabClick(object sender, RadTabStripEventArgs e)
    private void AddPageView(RadTab radTab)
        RadPageView pageView = new RadPageView {ID = radTab.Value, Selected = true};
        // If the PageView is already added to the RadMultiPage, then don't add it again
        if (MasterMultiPage.PageViews.Cast<RadPageView>().Any(multiPage => multiPage.ID == radTab.Value))
            radTab.PageViewID = pageView.ID;
            radTab.PageView.Selected = true;
        // Add a new PageView to the RadMultiPage
        radTab.PageViewID = pageView.ID;
        radTab.PageView.Selected = true;// ERROR!!  radTab.PageView is always NULL
    private static void SelectTab(RadTab tab, bool withParent = true)
        // Select tab
        tab.Selected = true;
        // Determine if tab has tab
        if (withParent && tab.Parent is RadTab)
  2. Answer
    Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 22 Feb 2012 Link to this post

    Hi Thad,

    In order to use RadTabStrip and RadMultiPage they both should be in one and the same NamingContainer. This is the cause of your issue, since in your case the controls are in different NamingContainer.

    Kind regards,
    Dimitar Terziev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top