Text value of Dropdown.

  • Thread starter Thread starter tshad
  • Start date Start date
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
 
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
 
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

Back
Top