Question about DropDownList Value

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...
 
R

Rob Schieber

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top