I'm in a similar boat - but can't claw my way out.
My module displays information - and then I dynamically add my own "Comments" control to the page. The "Comments" control accepts comments and add teh comments to a repeater if the user is logged in - or sends the user an email if logged out.
This works fine!
But now I'm trying to implement templating ability and am losing everything on my postback. When/If the template contains the token [COMMENTS] I run the follwing bit of code -- note - my ascx only has a PlaceHolder control on it named phListing:
Control d = LoadControl("Controls/Comments.ascx");
((Directory.Controls.Comments)d).name = listing.Name;
phListing.Controls.Add(d);
The comments control contains it's own button. And when I click it - everything dis-appears - Because the page needs to be reloaded. How can I persist it so my comments control will work? I've tried placing an update panel INSIDE my comments module - but nothing seems to be happening when I click it.... and if I click it a second time - the page seems to "refresh" to nothing again.
I've also tried to add the above control code to another placeholder and add the placeholder to the phListing --- but that didn't work (and didn't seem to be the right thing to do). I'm monkeyed with the Page_Init() but that gave me two sets of controls.
I'm more than a little confused, but am pretty sure it can be acomplished with a little bit more work... what am I missing?
Thanks All!