Custom control dropdownlist - need advice

Discussion in 'Software' started by tcstom, Apr 18, 2008.

  1. tcstom

    tcstom

    Joined:
    Apr 18, 2008
    Messages:
    1
    I'm building a custom control (ASP.NET 1.1 / C#) that contains a number of dropdownlists. I'm fairly new to custom controls and am having trouble understanding a couple of things. I'm adding the DDLs as part of the CreateChildControls method and binding their data at the same time but on postback these DDLs have an item count of zero again. Is it possible to persist the state of a control added in this way across postbacks? What I don't understand is that if I re-bind the DDL on postback then its SelectedIndex is set to the posted value at some point between the end of CreateChildControls and Render. Is it possible to have a custom control containing a dropdownlist which only needs to be bound once on the initial load...?
     
    tcstom, Apr 18, 2008
    #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. aidoCo
    Replies:
    2
    Views:
    17,915
  2. neoupadhyay

    DropDownList

    neoupadhyay, Mar 23, 2007, in forum: Software
    Replies:
    0
    Views:
    844
    neoupadhyay
    Mar 23, 2007
  3. visj4u

    DropdownList in gridview

    visj4u, Apr 27, 2007, in forum: Software
    Replies:
    0
    Views:
    1,226
    visj4u
    Apr 27, 2007
  4. mrugesh_dulera
    Replies:
    0
    Views:
    1,837
    mrugesh_dulera
    Jun 26, 2007
  5. Chandu

    .Net, binding dropdownlist

    Chandu, Jun 2, 2011, in forum: Software
    Replies:
    0
    Views:
    1,518
    Chandu
    Jun 2, 2011
Loading...

Share This Page