User Control Dropdownlist: can't assign value to

Discussion in 'ASP .Net' started by JJ_377@hotmail.com, Jul 22, 2005.

  1. Guest

    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.
     
    , Jul 22, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piotr Strycharz
    Replies:
    7
    Views:
    9,833
    Kevin Spencer
    Sep 30, 2003
  2. ABC
    Replies:
    1
    Views:
    2,852
    Larry
    Oct 4, 2005
  3. ABC
    Replies:
    0
    Views:
    627
  4. Mad Scientist Jr
    Replies:
    0
    Views:
    906
    Mad Scientist Jr
    Mar 22, 2006
  5. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    813
    Jonathan Wood
    Feb 2, 2010
  6. Philjo

    Programmatically assign dropdownList to a GridView control

    Philjo, Sep 20, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    2,103
    Philjo
    Sep 20, 2006
  7. ABC
    Replies:
    0
    Views:
    356
  8. E
    Replies:
    2
    Views:
    231
Loading...