Question about DropDownList Value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone please tell me why I get the numeric value using SelectedValue
and not the Text value???

I have tried to use selectedList but I get an error...

I want to return the text value selected from a drop down list but don't
know how to do it!

Dim sMsg As String

sMsg = "Office : " & ddlOffName.SelectedValue & vbCrLf


Thanks for any advice...
 
Tim::.. said:
Can someone please tell me why I get the numeric value using SelectedValue
and not the Text value???

I have tried to use selectedList but I get an error...

I want to return the text value selected from a drop down list but don't
know how to do it!

Dim sMsg As String

sMsg = "Office : " & ddlOffName.SelectedValue & vbCrLf


Thanks for any advice...


Try ddlOffName.SelectedItem.Text, selected value will give you the
actual value, i.e. if you hit view source and look at the values for
each <select> tag.
 

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