Problem: adding textbox during runtime (VB.NET) webforms

T

ton

Hi,

I want to add several textbox to my form during runtime: the code is very
simple

Lab = New TextBox
Lab.ID = "A" & i
Lab.Height = 200
Lab.Visible = True
Lab.Text = "test"
Lab.Attributes.Add("runat", "Server")
Lab.Attributes("style") = " LEFT: " & x & "px; POSITION:
absolute; TOP:" & 250 * i & "px "
Controls.Add(Lab)

after this I receive an error which tells me that the textbox should be
placed within a form label with runat=server.
Adding a label works fine

thanks


ton
 
T

ton

solved. I've changed the code to:
Page.FindControl("form1").Controls.Add(Lab) the runat attributes is not
necessary

But I have another problem, the textbox is displayed behind a table. I want
to have it on top of the table.


Who can help me


Thanks

ton
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top