Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining a Value from the DropDownList
Message
 
To
03/05/2004 06:07:43
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00900311
Message ID:
00900335
Views:
25
>I need to obtain the value displayed in a DropDownListBox.
>
>How can I obtain the value displayed or selected within the >DropDownListbox? I thought it would be something simple like >DropDownListbox.value, but apparently that is too simple.

Bill,

I'm assuming this is a web dropdownlist...

If you want the index of the selected item use something like:
mySelectedIndex = ddlMyDropDownList.SelectedItem.Value
To get the text of the selected item use something like this:
mySelectedText = ddlMyDropDownList.SelectedItem.Text
It is simple, but the terminology can throw you off (as it did me <g>).

Regards,
Carl.
Carl Olson, Jr.
CEO, Founder
Cerelogic, Inc.

www.cerelogic.com

"Applying rocket science to business."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform