A simple page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Slim

    A simple page

    I have a simple page with a button.

    when the button is clicked it creates a new button, all works fine so far

    When the second button is clicked it should create a third button, but this
    is where it fails.

    How should I go about getting this to work



    Partial Class test_buttons

    Inherits System.Web.UI.P age

    Dim bt2 As Button

    Dim bt3 As Button

    Protected Sub Button1_Click(B yVal sender As Object, ByVal e As
    System.EventArg s) Handles Button1.Click

    bt2 = New Button

    bt2.Text = "Button2"

    AddHandler bt2.Click, AddressOf bt2Click

    form1.Controls. Add(bt2)

    End Sub

    Sub bt2Click(ByVal sender As Object, ByVal e As System.EventArg s)

    bt3 = New Button

    bt3.Text = "Button3"

    form1.Controls. Add(bt3)

    End Sub

    End Class


Working...