I am adding a dynamically constructed set of checkboxes to an asp.net page from code located with something like this in a recursive way:
pnlPageAccessList.Controls.Add(myCheckboxControl);
The controls are displayed on the page, but they are not displayed when I look at the source, and also can not access them from the code. If I add controls to the on_init method, they will work. But I have some business rules that make changes to the list of controls themselves, which require me to run the add method elsewhere. Has anyone seen this before? I do not work, so I can not copy the exact code.
I have two terrible ideas on how to make it work. One includes some jQuery and a set of hidden controls containing a large array of integers; another runs the on_init AND method on my other events, so the controls at least show up. Both smell like ugly khaki. The second, which, I suspect, will not work to read the values from the flags.
source
share