Drop Down List Box Asp.net (VB)

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

Guest

I have a drop down list box that I populate with dat

I actually have two of them, one databound, one not. The problem is that I can't seem to get the system to recognize that I have actually selected something different than the default.

In the forms edit button I call the code like the following example

Dim MyUsr As UserRe
MyUsr = New UserRe
MyUsr.MyValue = DDLListValues.SelectedValu
MyUsr.Updat

Yet no matter what I select when running the code, the item selected at form_load is always saved as the value

Anyone know what I am doing wrong

Thank

Art DeBuign
 
Hi, Art

There might be 2 reasons
1. You rebind the dropdownlist when the page is posting back. try only bind the dropdownlist in the first load
If not IsPostback() The
'Bind dropdownlist
End I
2. I don't see any property name with selectedValue. try dropdownlist.SelectedItem.Value to get the selected value

BTW, post ASP.NET related problems in DotNet.Framework.aspnet

Bin Song, MC

----- Art DeBuigny wrote: ----

I have a drop down list box that I populate with dat

I actually have two of them, one databound, one not. The problem is that I can't seem to get the system to recognize that I have actually selected something different than the default.

In the forms edit button I call the code like the following example

Dim MyUsr As UserRe
MyUsr = New UserRe
MyUsr.MyValue = DDLListValues.SelectedValu
MyUsr.Updat

Yet no matter what I select when running the code, the item selected at form_load is always saved as the value

Anyone know what I am doing wrong

Thank

Art DeBuign
 
Doh! That was it. I knew I would be slapping my forehead on this

Worked like a charm, and thanks for the posting note. My bad

Art
 
Back
Top