Accessing RadTabStrip ID from associated ContentURL page

2 posts, 0 answers
  1. Mike
    Mike avatar
    3 posts
    Member since:
    Oct 2011

    Posted 17 Nov 2011 Link to this post

    Hi,
    I have a main page (default.aspx) with a RadTabStrip, and associated RadMultiPage and RadPageViews.  The RadPageViews use ContentURL to load their content.  On the first ContentURL page I have a button which when clicked should cause the RadTabStrip's second tab to be selected.  This is somewhat similar to the TabStrip/Wizard demo program.  My problem is in the first ContentURL page's button clicked callback I can't get the reference to the RadTabStrip control using FindControl - FindControl returns null.  Is what I'm trying to do possible?

    Thanks,
    Mike

    Here's my code:
    default.aspx:
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <div id="wrap">
            <div id="inner-wrap">
                <div id="main">
                    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" MultiPageID="RadMultiPage1"
                        Skin="Black">
                        <Tabs>
                            <telerik:RadTab runat="server" BackColor="Black" Text="Home">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" BackColor="Black" Text="Users">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage ID="RadMultiPage1" SelectedIndex="0" runat="server">
                        <telerik:RadPageView ID="RadPageView1" ContentUrl="administrativeHub.aspx" runat="server"
                            Height="250px">
                        </telerik:RadPageView>
                        <telerik:RadPageView ID="RadPageView2" ContentUrl="users.aspx" runat="server" Width="100%"
                            Height="150px">
                            Users</telerik:RadPageView>
                    </telerik:RadMultiPage>
                </div>
            </div>
        </div>
        </form>
    </body>

    administrativeHub.aspx:
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadButton ID="UserListB" runat="server" Text="User List" ButtonType="LinkButton"
            Skin="Black" ToolTip="Add users, remove users, and edit user information" Width="170px"
            OnClick="UserListBClick">
        </telerik:RadButton>
        </form>
    </body>

    administrativeHub.aspx.cs:
    namespace RadControlsDemo
    {
        public partial class administrativeHub : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
     
            }
            protected void UserListBClick(object sender, EventArgs e)
            {
                     //The following call to FindControl returns null
                RadTabStrip tabStrip = (RadTabStrip)Page.FindControl("RadTabStrip1");
                RadTab UsersTab = tabStrip.FindTabByText("Users");
                UsersTab.Enabled = true;
                UsersTab.Selected = true;
            }
        }
    }
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 22 Nov 2011 Link to this post

    Hi Mike,

    Unfortunately since the ContentUrl property renders an iframe you can not access the RadTabStrip control from the ContentUrl page. You can also refer to the following forum posts where similar issues are being discussed:
    http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/get-reference-to-multipage-in-contenturl-page.aspx
    http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/radmultipage-with-contenturl-how-to-access-parent-page-controls.aspx#1543539

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top