Usercontrol with button - When uc is added dynamically to another page I loose the button handler.
ie: I have 1 usercontrol with 1 button - the button has an event handler in the code behind. When i add the UserControl to a page programatically the button handler does not fire. Any idea of an easy way to fix this.
Typically when ive added controls dynamically to a page, i've had to re-wire the event handlers on every post back, but i was hoping since that button was contained in a UserControl and the uc was added dynamically i wouldnt loose it - doesnt seem to be the case - is there a better way to do this? My usercontrol will eventually have MANY buttons on it and i dont want to have to re-wire them everytime from the page that is dynamically adding the usercontrol.