locked
Multiple dynamic compositecontrol question RRS feed

  • Question

  • User28112566 posted

    I have a compositecontrol that consists of a number of compositecontrols.  When the page postbacks I need to re-create the controls so that Viewstate can do it's bit.  The problem is that at OnPreInit I cannot get the number of controls that should be created, can anybody give me an idea on how I can find out/pass how many controls should be created.

    cheers

    Wednesday, August 20, 2008 12:45 PM

Answers

  • User-16411453 posted

    It's PreInit, that controls don't exist yet!.  There's nothing to count, the controls don't exist. 

    See this post and use the example anwser as a template for your control.  Then all of your values will stay on postback

    http://forums.asp.net/t/1303475.aspx

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 21, 2008 6:16 PM