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. Advertising

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. Grey

    Assign value to HTML control

    Grey, May 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,402
    Ashish M Bhonkiya
    May 20, 2004
  2. Replies:
    1
    Views:
    441
    Cowboy \(Gregory A. Beamer\)
    Apr 25, 2007
  3. Philjo

    Programmatically assign dropdownList to a GridView control

    Philjo, Sep 20, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    1,832
    Philjo
    Sep 20, 2006
  4. Replies:
    0
    Views:
    902
  5. Assign value to control

    , Apr 15, 2005, in forum: Javascript
    Replies:
    9
    Views:
    177
    Richard Cornford
    Apr 17, 2005
Loading...

Share This Page