adding extra controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I need to create a website in asp.net. I want to put a button on the site. I
want to do something like that, after clicking the button a new textbox
should appear on the site. When someone has clicked again, there will be a
new texbox more. And so on.
Is it possible? How to do that?
 
On button click event you can write:


Dim myLabel = New Label()
myLabel.Text = "Sample Label"
Form1.Controls.Add(myLabel)

Dim myTextBox = New TextBox()
myTextBox.ID = "TextBox1"
myTextBox.Text = "Hi"
Form1.Controls.Add(myTextBox)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top