473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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

Feb 22 '08 #1
1 1917
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

"ton" <to*@nospam.nlschreef in bericht
news:51**************************@cache4.tilbu1.nb .home.nl...
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


Feb 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: filip stas | last post by:
How do i add references during runtime?
2
by: manohar.shankar | last post by:
Hi, I have been searching on this topic for quite sometime and didnt get any answer. Is there a way I can extend/add methods/properties to a C# class during runtime. eg., I have class:...
0
by: Hai Nguyen | last post by:
I want to add a text box into a template column during runtime. I can add a boundcolumn but not with template column. I allow user to type in something in the textbox in the datagrid. I wanna know if...
2
by: Rex | last post by:
Hi, I want to make a particular piece of text BOLD (during runtime) in a textbox. for example: consider a string "The next stage for plaque collection will be at the end of January". I want to...
2
by: hufaunder | last post by:
I have to present inputs (textbox, combobox, etc) that are not known during design time. In the past this was pretty simple to do. You just add a new control to the Controls property of a form. How...
1
by: =?Utf-8?B?TWFyaW8=?= | last post by:
hi, i would like to add pictureboxes during runtime, but there should not be a specific variable for each picturebox becouse i don't know how much it will be. so i declared a collection...
5
by: shubhlu | last post by:
hi I have a problem that I have a COM dll and i need to access the methods in that dll. But what is required here is that the dll needs to be added as a reference only during runtime and not...
2
by: Maniax | last post by:
I am trying to make a program which adds 12 text boxes in a line when the user presses a button... however i want that button to be able to be clicked for as many times as the user needs... how can i...
1
by: paul snow | last post by:
I'm having this System.TypeInitializerException problem but only during runtime in a separate environment than its own build environment. Win7x64 is the build environment. I'm testing the project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.