Search code examples
asp.nettelerikmultipage

How can I link to a specific tab (Telerik RadTab) from another page


I'm using Telerik (for ASP.NET AJAX) RadMultiPage controls to produce nested tabs and I would like to link to a specific tab from another page. But I couldn't find a proper way.

Here is my code

<telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1" SelectedIndex="0">
    <Tabs>
        <telerik:RadTab Text="ParentTab1"></telerik:RadTab>
        <telerik:RadTab Text="ParentTab2"></telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>

<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
    <telerik:RadPageView ID="ParentTab1" runat="server" >
        <telerik:RadTabStrip runat="server" ID="RadTabStrip2" MultiPageID="RadMultiPage2" SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="ChildTab1"></telerik:RadTab>
                <telerik:RadTab Text="ChildTab2"></telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage2" SelectedIndex="0" runat=server>
            <telerik:RadPageView ID="ChildTab1" runat="server">
                <%--ChildTab1 Content--%>               
            </telerik:RadPageView>
            <telerik:RadPageView ID="ChildTab2" runat="server" >
                <%--ChildTab2 Content--%>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </telerik:RadPageView>
</telerik:RadMultiPage>

And it looks like:

screenshot

The question is how could I insert a link exactly points to "ChildTab2" into another page.


Solution

  • The quick answer is "You can't".

    The tabs are simple HTML and JavaScript, when you click a tab, the display of the PageViews is switched, that's all. These are not anchors that you can switch to.

    What you can consider is adding a querystring parameter that you can work with in the code-behind and set the selected tab as desired.

    Of course, you can do this on the client, but accessing the controls may be a tad harder, and so is parsing the URL (whether it is a querystring or a hash).