DropDownList SelectedItem.Value or SelectedValue not working when TabPanel is removed




DropDownList SelectedItem.Value or SelectedValue not working when TabPanel is removed
If you're using the TabContainer, which is part of the Ajax Control Toolkit and have noticed that when you remove a tab you have issues accessing the values from a DropDownList using .SelectedItem.Value or .SelectedValue then below is the solution:
 
Instead of using the below to remove a tab:
  1. TabContainer1.Tabs.Remove(TabPanel1)  
Use this code to remove the tab instead:
  1. TabContainer1.Tabs.Item(0).Visible = False  
As you can see, you need to state the index rather than the id, but just remember that indexes start at 0.


No one has said that they like article yet, be the first and click here (0)
Send a link to this page via email Send a link to this page