A
asptodotnet
I have created a function that generates states and I now need to figure out
how to read the values from it and then set one of the options to selected.
Here is the code that I currently have, but it doesn't work.
Dim hf As New helperfunctions()
stateprovincedropdown.DataTextField = "text"
stateprovincedropdown.DataValueField = "value"
stateprovincedropdown.DataSource =
hf.BindStatesDropDownList(advertiser.BillingAddress.StateProvince.ToCharArra
y)
stateprovincedropdown.DataBind()
If advertiser.BillingAddress.StateProvince.ToUpper =
stateprovincedropdown.SelectedItem.Value Then
stateprovincedropdown.SelectedItem.Selected = True
End If
Thanks!
how to read the values from it and then set one of the options to selected.
Here is the code that I currently have, but it doesn't work.
Dim hf As New helperfunctions()
stateprovincedropdown.DataTextField = "text"
stateprovincedropdown.DataValueField = "value"
stateprovincedropdown.DataSource =
hf.BindStatesDropDownList(advertiser.BillingAddress.StateProvince.ToCharArra
y)
stateprovincedropdown.DataBind()
If advertiser.BillingAddress.StateProvince.ToUpper =
stateprovincedropdown.SelectedItem.Value Then
stateprovincedropdown.SelectedItem.Selected = True
End If
Thanks!