PatelNehal4u
Active member
- Joined
- Apr 6, 2009
- Messages
- 25
- Programming Experience
- 1-3
Hello Everyone,
I am new to asp.net and i had created a form with a button, which create a new button dynamically, i bind that button with an event but when i press newly created button it again got deleted and no response from it. Here is the coding.
I am new to asp.net and i had created a form with a button, which create a new button dynamically, i bind that button with an event but when i press newly created button it again got deleted and no response from it. Here is the coding.
VB.NET:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim btn As New Button
btn.Text = "My New Button"
btn.EnableViewState = True
Panel1.Controls.Add(btn)
AddHandler btn.Click, AddressOf btn_click
End Sub
Protected Sub btn_click(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Write("Button Clicked")
End Sub