Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDownList BUG 1

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
I've found a strange bug on the DropDownList. If you use two items with the same value and select the second one, after the post back, the first is selected.
The state property should save the SelectedIndex property, but instead, it saves the SelectedItem.Value.
I had a list with the following data:

Index Value Text
===== ===== ======
0 '0' ''
1 'Home' 'Myhome'
2 'Work' 'MyWork'
3 'Home' 'OtherHome'
4 'Room' 'MyRoom'

If the selectedindex is 3 before the postback, after that is 1.

My advice is: Try never use repeated values.

This is just a warning, just in case strange things happen with your DropDownList.
NetAngel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top