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:

TabContainer1.Tabs.Remove(TabPanel1)

Use this code to remove the tab instead:

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.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.