Custom control dropdownlist - need advice

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

  1. tcstom


    Apr 18, 2008
    Likes Received:
    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. Advertisements

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 (here). After that, you can post your question and our members will help you out.