0

hi,
i have a problem with my tabcontainer that once user click the tab, it will not remains the tab but goes to the default tab..
This is my code

<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>    
             <cc1:TabContainer ID="MyTabContainer" runat="server" ActiveTabIndex="0>
       
                <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Company">
                    <ContentTemplate>
                        <a href="<%= Page.ResolveUrl("~")%>MASTER/Company_a.aspx" >Company Entry</a>&nbsp;&nbsp;&nbsp;
                        <a href ="<%= Page.ResolveUrl("~")%>MASTER/Company_v.aspx">View Company </a>&nbsp;&nbsp;&nbsp;
                    </ContentTemplate>
                </cc1:TabPanel>
               
                <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="User">
                    <ContentTemplate>                      
                        <a href ="<%= Page.ResolveUrl("~")%>MASTER/User_a.aspx">User Entry </a>&nbsp;&nbsp;&nbsp;
                        <a href ="<%= Page.ResolveUrl("~")%>MASTER/User_v.aspx">View User </a>
                    </ContentTemplate>
                </cc1:TabPanel>
                          
                <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
                    <ContentTemplate>
                        Tab 3
                    </ContentTemplate>
                </cc1:TabPanel>
           
            </cc1:TabContainer>
2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by new SE
0

Hi,
You have to set the active tab index property after the event completed on a particular tab to the tab index(on page load).
hope your reply

0
protected void Page_Load(object sender, System.EventArgs e) 
    {
         if ( !(ViewState["ActiveTabIndex"] == null) && (! (sender == null))) 
        {
            if (sender.GetType().ToString().Equals("AjaxControlToolkit.TabContainer")) 
            {
                ((AjaxControlToolkit.TabContainer)sender).ActiveTabIndex = (int)ViewState["ActiveTabIndex"];
            }

        }

    }
    protected void MyTabContainer_ActiveTabChanged(object sender, EventArgs e)
    {
        ViewState["ActiveTabIndex"] = MyTabContainer.ActiveTabIndex;
    }

this is what i have tried, but did't work..
can you explain a little bit more

0

Hi,
No need to set the active tabindex on activetabchanged event normaly.You have to set the active tab index to on pageload if you want to display the required tab after a particular event fired from that tab like post comments etc.
Usually without any help of code the tabcontainer shows the selected tab by clicking on it.
hope your reply

0

actually i cannot how all those thing work..can you show me some sample code?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.