M
Matthew MacDonald
Hi all,
I'm trying to make a web form that will allow the user to continuously add
options to a form by clicking a button.
Here is my sample code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim drop As New DropDownList
tblMain.Rows(13).Cells(1).Controls.Add(drop)
End Sub
I want this to keep adding new drop down lists to the table whenever the
user clicks the button. What happens, however, is that the page reloads and
only one new control is ever added to the page (or more exactly, the
previous new control is wiped out and a new one is added, thus only ever
having one)
Any ideas on this??
Thanks, Matt
I'm trying to make a web form that will allow the user to continuously add
options to a form by clicking a button.
Here is my sample code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim drop As New DropDownList
tblMain.Rows(13).Cells(1).Controls.Add(drop)
End Sub
I want this to keep adding new drop down lists to the table whenever the
user clicks the button. What happens, however, is that the page reloads and
only one new control is ever added to the page (or more exactly, the
previous new control is wiped out and a new one is added, thus only ever
having one)
Any ideas on this??
Thanks, Matt