Hello,

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 ? :)

miculnegru>no one ?

Yes, There is no problem with ScriptManager, UpdatePanel, UserControl, and ScriptManagerProxy.

If your code doesnot function then post the complete code.

what are you tring to achive here?
try to be more specific and maybe as adatapost said try to put your code in here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.