I think I need to figure out how to register the controls and their events with the page without going through a full page postback. The following code sample is a UpdatePanel-free page using a user control that works, later I will show the same code with an UpdatePanel that does not. Theoretically, adding the User Control to the PlaceHolder should register itself and it's controls and events with the page, but it does not.
The LoadConrol method and then add it to the page via a PlaceHolder control. The controls do not get registered with the page and events from them do not fire (for instance, a button click event never hits the event breakpoint).īecause the very same user control works fine if loaded in a full postback or dynamically added from a namespace works fine, I can be relatively sure that it only is trouble when loading via a partial page update into an UpdatePanel. HOWEVER, if instead of using a full postback you use an UpdatePanel and a partial page update of the UpdatePanel The controls within the user control are registered properly in the page and any update panels included in the user control also work properly. When programmatically adding a User Control to a web page through a normal postback everything works fine.
The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels and User Controls. Through testing I have been able to find the cause of the problem, and willĭescribe it here first textually and then through a code example.
I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution.