B
Bob
Hi,
I'm working with VWD and i defined programmatically a button (in
code-behind) with an ID. So I expect to see beside "Page Events" and "Form1"
my button "b1" in order to use the Click event. But it doesnt' appear. After
saving the code-behind file, i only see "Page Events" and "Form1".
If i define the button declarativally, i see it. But i need to define it
programmatically.
Can anybody tell me how to do? I also tried with Attributes.add but that's
only for client script.
Thanks
Bob
The code:
---------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim b As New Button
b.ID = "b1"
form1.Controls.Add(b)
End Sub
I'm working with VWD and i defined programmatically a button (in
code-behind) with an ID. So I expect to see beside "Page Events" and "Form1"
my button "b1" in order to use the Click event. But it doesnt' appear. After
saving the code-behind file, i only see "Page Events" and "Form1".
If i define the button declarativally, i see it. But i need to define it
programmatically.
Can anybody tell me how to do? I also tried with Attributes.add but that's
only for client script.
Thanks
Bob
The code:
---------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim b As New Button
b.ID = "b1"
form1.Controls.Add(b)
End Sub