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

  • Thread starter Thread starter ton
  • Start date Start date
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
 
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
 
Back
Top