Skip to main content

ASPxClientTabControlBase.SetActiveTab(tab) Method

Makes the specified tab active within the tab control on the client side.


    tab: ASPxClientTab
): void


Name Type Description
tab ASPxClientTab

An ASPxClientTab object specifying the tab to select.


End users are allowed to select tabs via mouse clicks. The tab control also provides the ability to select tabs on the client side via code. You can use the SetActiveTab method for this purpose.

Note that a tab control always has the active tab and only one tab can be active within the control at the same time. So the SetActiveTab method is in effect if it’s passed a correct tab index which lies in the range of 0 to the ASPxClientTabControlBase.GetTabCount value decremented by one.


This example demonstrates how to use the ASPxPageControl.ShowTabs property. The ASPxPageControl has three tab pages, selected by clicking the ASPxNavBar‘s item client.

<dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" 
ClientInstanceName="PageControl1" Height="101px" ShowTabs="False" Width="228px">
                <dxtc:TabPage Text="Tab1">
                        <dxw:ContentControl runat="server">
                            Page1 content
                <dxtc:TabPage Text="Tab2">
                        <dxw:ContentControl runat="server">
                            Page2 content
                <dxtc:TabPage Text="Tab3">
                        <dxw:ContentControl runat="server">
                            Page3 content

<dxnb:ASPxNavBar ID="ASPxNavBar1" runat="server" AllowSelectItem="True">
                        <dxnb:NavBarItem Text="Item1" Selected="True">
                        <dxnb:NavBarItem Text="Item2">
                        <dxnb:NavBarItem Text="Item3">
            <ClientSideEvents ItemClick="function(s, e) {
     case 0: {PageControl1.SetActiveTab(PageControl1.GetTab(0)); break;}
     case 1: {PageControl1.SetActiveTab(PageControl1.GetTab(1)); break;}
     case 2: {PageControl1.SetActiveTab(PageControl1.GetTab(2)); break;}

         }" />
See Also