Y
Yuriy
I added controls dynamicaly to placeholder control and
declared event to control. When I try execute event it
doesn't work on server side.
Protected WithEvents myButton1 As
System.Web.UI.WebControls.Button
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
myButton1 = New WebControls.Button()
myButton1.EnableViewState = True
myButton1.Text = "WebControls"
PlaceHolder1.Controls.Add(myButton1)
'add event to control
AddHandler myButton1.Click, AddressOf
ButtonServer_Click
hdnControl.Text = "WebControls1"
PlaceHolder1.Controls.Add(New LiteralControl
("<br>"))
End Sub
'this is a ButtonServer_Click
Private Sub ButtonServer_Click(ByVal s As Object, ByVal e
As System.EventArgs)
Dim bt As HtmlButton
Dim strInnerText As String
bt = s
End Sub
Probably it is a some mistake. If you know the answer or
can refer me to some side i will be appriciate it.
Thank you.
declared event to control. When I try execute event it
doesn't work on server side.
Protected WithEvents myButton1 As
System.Web.UI.WebControls.Button
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
myButton1 = New WebControls.Button()
myButton1.EnableViewState = True
myButton1.Text = "WebControls"
PlaceHolder1.Controls.Add(myButton1)
'add event to control
AddHandler myButton1.Click, AddressOf
ButtonServer_Click
hdnControl.Text = "WebControls1"
PlaceHolder1.Controls.Add(New LiteralControl
("<br>"))
End Sub
'this is a ButtonServer_Click
Private Sub ButtonServer_Click(ByVal s As Object, ByVal e
As System.EventArgs)
Dim bt As HtmlButton
Dim strInnerText As String
bt = s
End Sub
Probably it is a some mistake. If you know the answer or
can refer me to some side i will be appriciate it.
Thank you.