Lets explain the problem with a simple case:
Lets CC be a composite control.
CC has a variable called filter (string) stored in viewState.
CC has 2 static child controls:
The user type a search term and click on the searchButton.
the following steps happens:
PageLoad
CreateChildControls:
Click event is fired
searchButton_click handler does the following:
I need to recreate the child control hierarchy but also to maintain the child controls viewstate ! Otherwise, my editButtons's Click events will not be fired at all.
Is there a way to achieve this ? I keep searching but I cannot find any solution. I will be glad to get some help from you guys.
Hope you anderstand my problem, ask questions/code illustration if needed.
Best regards
Quick
Ok, i have found a solution:
The trick was to give an ID to each editButton (string.format("editButton_{0}", i).
If you have better solution, please let me know.