Protected Sub btnView_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnView.Click con = New SqlConnection(constr) Dim btnDynamic As New Button
btnDynamic.ID = "btnDynamic" btnDynamic.Text = "Dynamic Button"
AddHandler btnDynamic.Click, AddressOf OnClick form1.Controls.Add(btnDynamic) Private Sub OnClick(ByVal sender As Object, ByVal e As System.EventArgs) Dim buttonId As String buttonId = DirectCast(sender, Button).ID Response.Write("Button clicked: " + buttonId) End Sub
btn.Click += new EventHandler(btn_Click);
protected void btn_Click(objectsender e,Eventargs args) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)