Search code examples
asp.netajaxcontroltoolkit

How do I know if a tab is selected?


I am trying to get a report based on different information located in tabs. How do I know If a tab is selected? I looked for something like:

if(colorListTab.isSelected)
{

}

but no luck! Can you guys help me out with this?

enter image description here


Solution

  • You could use the ActiveTab property, for example(in ActiveTabChanged):

    if(TabContainer1.ActiveTab.Equals(colorListTab)){
    
    }
    

    or you could use the ActiveTabIndex:

    if(TabContainer1.ActiveTabIndex == 1){ //second tab
    
    }
    

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=178