This old chestnut again.
My page is structured as follows; I have a drop-down list that binds to the first boot. When the user selects a value from this, a postback is performed, which then binds the data to the repeater.
The ItemTemplate of this repeater control contains an entry control. In the code located in the ItemDataBound event of the repeater, I add two controls dynamically to this placeholder, hidden field and checkbox.
When the user clicks the save button, I then want to iterate over all these dynamically created hidden fields and check boxes and determine their values. However, when the user clicks the save button, these controls no longer exist, as shown on the page.
I know this is a life-cycle problem, and the articles I saw on this suggest using Init methods to dynamically create your controls, but I can't because of how my page works, for example. The repeater control appears and binds after selecting a value from the drop-down list.
What do I need to do to support dynamic controls through postback triggered by pressing the save button?
source
share