Hi,
I have the following Scenario:
1. A composite Control called ctrl1.
2. In order to add it to a webpartzone at runtime i have written a wrapper class. This wrapper class inherits from the webpart calss and creates an instance of ctrl1 and adds it to the controls collection in the "CreateChildControls()" method.
3. On the aspx page onInit i am calling the webPartmanager.AddwebPartmethod and in this i am adding an instance of the wrapper class.
4. All this is enabling me to add the composite control to the web part zone at runtime.
5. However when i click on my composite control despite having a postback i am still seeing a new instance of ctrl1 being created and added to this web part. This is NOT the expected behaviour for me.
Please suggest how i can resolve this. I have tried overriding EnsureChildControls() but it doesnt help much.
Please advice.
Thanks and Regards
Uma