User Control Dropdownlist: can't assign value to

J

JJ_377

The following doesn't assign value to the dropdownlist - WHY?
___________________________________________________________________
In a user control (ascx named USACustomer) :

Public Property State() As String
Get
Return Me.ddlState.SelectedValue
End Get

Set(ByVal Value As String)
ddlState.SelectedValue = Value
End Set
End Property

In the webform:

If Not IsDBNull(drCustomer("State")) Then
USACustomer.State = drCustomer("State")
End If
__________________________________________________________________
drCustomer("State") -- a datareader that fills the dropdownlist-- does
have a value and when I step into the Property assignment statement,
Value is assigned to the datareader's value: drCustomer("State").

However, dropdownlist ddlState does not get assigned from the Property,
Value that is assigned in the User Control. In contrast, I can
successfuly assign textbox controls in the User Control using similiar
methodology from the datareader.

THANK YOU.

J.
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top