My problem is :
I have a .aspx page where I use a ScriptManager and a UpdatePanel.
In the update panel I generate controls based on user interactions.
My problem is this : when I add dynamically the CustomControl (.ascx page ) in the UpdatePanel ( the CustomControl has a ScriptManagerProxy ) the AsynchronousPostBack for the .ascx page doesn't work, at all.
The fact that this is the first time I try this is not a bonus :D .
code for adding the user controls :
Control myControl = Page.LoadControl("NewUser.ascx"); myControl.ID = "NewUser"; placeHolder.Controls.Clear(); placeHolder.Controls.Add(myControl);
placeHolder is in the UpdatePanel.
and all the Ajax calls inside the CustomControl are in the UpdatePanel of the CustomControls like this :
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> </asp:ScriptManagerProxy> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox runat="server" ID="txt_Username" OnTextChanged="txt_Username_TextChanged" /> </ContentTemplate> </asp:UpdatePanel>
So I see the dynamically added CustomControl in the page but the AsynchronousPostBack is not called for the CustomControl , any ideas ? Help ? :)