I have a whole lot of controls to be created dynamically. Where is the best place to run the code for that?
I have been running the CreateControls function (to create all controls) at Page_Load.
Now the problem is, when I uncheck/uncheck one particular dynamic checkbox control (autopostback = true), the checkbox is always set to "true" because the CreateControls function runs again at Page_Load on postback.
If I put the CreateControls function within the (!IsPostBack) of Page_Load, when I click on the dynamic checkbox control, all controls disappear.
I have been looking at this for days, any ideas appreciated!
EDIT: The CreateControls function binds all the controls to a Panel.