Hi at all! I'm italian, and i'm new in this forum...
i use Asp.net 3.5 and have an question with update panel and insert of button in it dinamicly.
I have 2 updatePanel, in Panel1 i have an button.
on click of this button i would add in Panel2 an new button, with an function associated, but all my tests not works!
this is my html:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
this is the VB code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New Button
x.ID = "bnTemporaneo"
x.Text = "temporaneo"
AddHandler x.Click, AddressOf Me.Mess
UpdatePanel4.ContentTemplateContainer.Controls.Add(x)
UpdatePanel4.Update()
ScriptManager1.RegisterAsyncPostBackControl(x)
UpdatePanel4.Update()
End Sub
Public Sub Mess()
MsgBox("msg temp")
End Function
But not work! button show, but if i click, it not call the function, and it will hide.
There are an solution at my problem? thanks very much!