Hey,
I created button dynamicaly and added handler to it, but for some reason, event do not fire, then I press it.
What can be wrong?
VB Code:
Protected WithEvents LeftPane As System.Web.UI.HtmlControls.HtmlTableCell Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Page.IsPostBack = False Then Dim myButton As New Button myButton.Text = "Save" myButton.ID = "SubmitButton" AddHandler myButton.Click, AddressOf Me.Submitas LeftPane.Controls.Add(myButton) End If End Sub Private Sub Submitas(ByVal sender As System.Object, ByVal e As System.EventArgs) Response.Write("Click") End Sub


Reply With Quote