DropDownList Im sure Im just missing something

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

Guest

I am new to vb.net here is my problem:

In a windows form I am populating a dropdown list with the
DropDownList1.Items.Add(SomeString) command.
the list populates and looks good however when I attempt to read what the
user has selected it always reads back the first item.

I am attempting to read the answers in a button procedure with the command:
cp = RTrim(DropDownList1.SelectedItem.Text)
Any Idea's why I cant do this?
 
Works for me. I put a DDL on the form, a button and a label.

Label1.text = RTrim(DropDownList1.SelectedItem.Text)


The label contains the selected item, works fine.


Perhaps you are doing something weird




--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
HAHa Im always doing something wierd
I actually figured is put a couple hours ago form was reloading on button
click clearing selection
the fix is to put "If Not Page.IsPostBack Then"
in the form load
thanks for your time
 

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