This is a migrated thread and some comments may be shown as answers.

Selected Tab Not Working

5 Answers 483 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 24 Mar 2009, 11:07 PM
I have a simple scenario where I have a tab strip on a materpage. Each tab has its NavigateURL set for a specific page. When I click on a tab I would like the tab to show its selected state when the page loads. But this is not happening. Here is my code snippet.

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="false" SelectedIndex="0" CssClass="tabStrip"
             <Tabs> 
                 <telerik:RadTab Text="Tools" NavigateUrl="../../pages/tools.aspx"
                 </telerik:RadTab> 
                 <telerik:RadTab Text="Washers" NavigateUrl="../../pages/washers.aspx"
                 </telerik:RadTab> 
             </Tabs> 
    </telerik:RadTabStrip> 
    </div> 
    <div id="ContentContainer"
                <asp:ContentPlaceHolder id="PlaceHolderMain" Visible="true" runat="server" /> 
        <div class="clear"></div> 
    </div> 


5 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 25 Mar 2009, 09:50 AM
Hello Robert,

Please refer to this example that shows how to achieve your goal.

Greetings,
Paul
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 25 Mar 2009, 02:21 PM
I have looked at that example before. My problem is that I do not understand how my solution will work with a multipage control when I have one content placeholder for my all my content pages. If I wrap the contentplaceholder control within one multipageview it does not work.

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="false" SelectedIndex="0" CssClass="tabStrip">   
                 <Tabs>   
                     <telerik:RadTab Text="Tools" NavigateUrl="../../pages/tools.aspx">   
                     </telerik:RadTab>   
                     <telerik:RadTab Text="Washers" NavigateUrl="../../pages/washers.aspx">   
                     </telerik:RadTab>   
                 </Tabs>   
        </telerik:RadTabStrip>   
        </div>   
        <div id="ContentContainer">   
<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">  
            <telerik:RadPageView ID="RadePageView1" runat="server">  
  
                    <asp:ContentPlaceHolder id="PlaceHolderMain" Visible="true" runat="server" />   
</telerik:RadPageView>  
        </telerik:RadMultiPage>  
  
            <div class="clear"></div>   
        </div>   

0
Atanas Korchev
Telerik team
answered on 25 Mar 2009, 02:25 PM
Hi Robert Johnson,

Since the unique content is in a separate content page you don't need a multipage control at all. Multipage is suitable in scenarios where all page views reside in the same ASPX.

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 27 Mar 2009, 06:36 PM
Hello Albert. Thanks for the quick reply. If I remove the multipage control, then I do not get the type of behavior I am looking for. When I click on a tab and that page loads into the contentplaceholder control, I want the tab to show its selected state. It seems to be defaulting to its initial state.
0
Accepted
Atanas Korchev
Telerik team
answered on 30 Mar 2009, 08:28 AM
Hi Robert Johnson,

This is by design. RadTabStrip can retain its selected tabs only within the same ASPX (for example after postback). In cases when you redirect between different ASPX-es you need the workaround which we suggested earlier - http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/sitenavigation/defaultcs.aspx

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
TabStrip
Asked by
Robert
Top achievements
Rank 1
Answers by
Paul
Telerik team
Robert
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or