Selected Tab Not Working

6 posts, 1 answers
  1. Robert
    Robert avatar
    19 posts
    Member since:
    Feb 2009

    Posted 24 Mar 2009 Link to this post

    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.

    1 <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="false" SelectedIndex="0" CssClass="tabStrip"
    2              <Tabs> 
    3                  <telerik:RadTab Text="Tools" NavigateUrl="../../pages/tools.aspx"
    4                  </telerik:RadTab> 
    5                  <telerik:RadTab Text="Washers" NavigateUrl="../../pages/washers.aspx"
    6                  </telerik:RadTab> 
    7              </Tabs> 
    8     </telerik:RadTabStrip> 
    9     </div> 
    10     <div id="ContentContainer"
    11                 <asp:ContentPlaceHolder id="PlaceHolderMain" Visible="true" runat="server" /> 
    12         <div class="clear"></div> 
    13     </div> 


  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 25 Mar 2009 Link to this post

    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.
  3. Robert
    Robert avatar
    19 posts
    Member since:
    Feb 2009

    Posted 25 Mar 2009 Link to this post

    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>   

  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Mar 2009 Link to this post

    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.
  5. Robert
    Robert avatar
    19 posts
    Member since:
    Feb 2009

    Posted 27 Mar 2009 Link to this post

    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.
  6. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 30 Mar 2009 Link to this post

    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.
Back to Top