Hello,
I have the following problem, I think it is rather simple, but hard to describe:
I created a simple user control which contains a check box and an image - CheckBoxImage.
Then I createa a control which contains and visually arranges CheckBoxImage controls in a table dynamically (it can contain diffrent numbers of ImageCheckBox)- CheckBoxImageContainer.
The CheckBoxImage are added to the container dynamically.
The problem is this:
When I first populate the container it has 20 (or diffrent number) ImageCheckBoxes, but, when a user checks or unchecks a check box in a certain ImageCheckBox, or presses a button, , I need to load new 20 diffrent ImageCheckBox into the container.
I can only know that during the event handling of the CheckBox selectedChange, my response is to remove the previous 20 ImageCheckBox and adding new 20 ImageCheckBox.
The problem is, that these check boxes won't react to onselectchanged events in this request, only after another postback.
I think it is because even though I first deleted the previous ImageCheckBox, When I populate the new ones their ids UniqueID are cont_ctl21, cont_cctrl22...., cont_cctl40, and on the first postback when they are populated their UniqueIDs are cont_ctl00, cont_ctl01, so the server doesn't recognize their selectChange Event, only after the next postback it is regonized (because now their IDs match the former postback).
Is there a way to solve this, for example to restart the control count on the container?
Thank you,
and if my question was not clear I would be happy to elaborate