Text value of Dropdown.

T

tshad

How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
 
?

=?iso-8859-1?Q?Guillermo_Gonz=E1lez_A.?=

Hi tshad,

Try this:

yourDropDownList.SelectecItem.Text

Guillermo G.

--------------------------------------------------------------------------------
Guillermo González Arroyave :: MCP ASP.Net C# :: DCE4

How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
 
B

Brock Allen

Is DropDownList.SelectedItem.Value what you're looking for?

Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S
 
T

tshad

HARI PRASD BARU said:
d1.SelectedItem.Text;

That was it.

I can never seem to remember that when I need it.

I never understood why you have a SelectedValue, but not a SelectedText.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top