in an ASP.net/C# application. I am using the an update panel and a Placeholder inside it to dynamically load controls
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click"/>
</Triggers>
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
When I click on the LinkButton1 I load a user control in the PlaceHolder:
protected void LinkButton1_Click(object sender, EventArgs e)
{
PlaceHolder1.Controls.Clear();
MyControl C;
C = (MyControl1 )LoadControl("Controls/MyControl.ascx");
PlaceHolder1.Controls.Add(C);
}
All the control I have are loadded correctly.
But the problem is this:
I have a control that uses Javascript and Jquery to create a drop down animation when I click on a div. This control works correctly when loaded on a page by a Normal PostBack But When I load it in the update panel using a partial post back, it loads but the javascript stops working (No more drop down animation and other stuff)
How can I make them work when loading the control via a partial postback?