i want to add a label to update panel, on button click.. i have following code in .aspx file...
<asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" >
<ContentTemplate >
<asp:Panel runat="server" ID="myPanel" >
<label id="ssd" runat="server" >abc</label>
</asp:Panel>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="test"/>
</ContentTemplate>
</asp:UpdatePanel>
and on button click event..
protected void Button1_Click(object sender, EventArgs e)
{
Label l1 = new Label();
l1.ID = "label1";
l1.Text = "this is it...";
up.ContentTemplateContainer.Controls.Add(l1);
}
but its not working ..:-(