How to make a Collection of WebControls as a property of a non-rendering control

Last post 04-03-2008 2:28 PM by LKB. 0 replies.

Sort Posts:

  • How to make a Collection of WebControls as a property of a non-rendering control

    04-03-2008, 2:28 PM
    • Member
      1 point Member
    • LKB
    • Member since 03-28-2008, 3:03 PM
    • Posts 8

    I'm working on a suite of controls to be used for easy database communication.  I've got a master control that handles all the connection properties and command building and then I have a bunch of controls which inherit from standard web controls like TextBox and Label.  The master control needs to be able to refer to the controls which it needs to build its select and update commands, but I'm having trouble finding a way here that works.

     I've tried having a collection of the controls, but the only way I can get this to work is if the master control handles all rendering.  This doesn't work out so well because there are often a number of controls on a page that don't tie out to the database.  Anything else results in copies of the controls in the list that don't update when the user enters values.

    I've tried just keeping a list of the control IDs but I'm having trouble getting a reliable reference to them from within the master class that way.

     Any suggestions on a better method?

Page 1 of 1 (1 items)