drop down list

vbnetcoder
vbnetcoder used Ask the Experts™
on
In a drop down list what is the value property typically used for

DropDownList.selecteditem.value
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
Its usually used for storing IDs of the text. so for example, you have a drop down list of customers. The text would be Customername and Value would be CustomerID so that you can use the ID for further opterations (as a foreign key or to load more data etc).
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
Are you referring to the SelectedValue member?
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
: \

Nevermind. I read the question wrong.
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
To expand on CodeCruiser's comment, DropDownList.selecteditem returns an object of type ListItem. This object has the members Text and Value. From here, it's as CodeCruiser states  : )

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial