473,323 Members | 1,550 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,323 software developers and data experts.

Creating TextBox dinamically

How I can create TextBox dinamically.
I have to create 10 textbox dinamically which name will be txtBox_01,
txtBox_02, etc...
Thanks.
Nov 13 '05 #1
2 12921
The way I do it is to dynamically write a bunch of HTML to a string, then
set the Text value of a label on the page to be that string. It's simple
but effective.

"Marco" <ma****@zipmail.com.br> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
How I can create TextBox dinamically.
I have to create 10 textbox dinamically which name will be txtBox_01,
txtBox_02, etc...
Thanks.

Nov 13 '05 #2
A

"Marco" <ma****@zipmail.com.br> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
How I can create TextBox dinamically.
I have to create 10 textbox dinamically which name will be txtBox_01,
txtBox_02, etc...


You can do something like this:

public void AddTextBoxes( int number ){
for( int i = 0; i < number; i++ ){
string name = "txtBox_" + ( i + 1 ).ToString( "00" );
TextBox txt = new TextBox();
txt.Name = name;
// Set other properties such as size and location and TabIndex if
you wish.
this.Controls.Add( txt );
}
}

-akshay
Nov 13 '05 #3

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

Similar topics

2
by: Daniel | last post by:
Hello!!! I'm creating controls dinamically in ASP.NET using VB. The problem is that i don't know how to catch the event of each button that i've create (the buttons are created dinamically). ...
5
by: Grisha0 | last post by:
Hi, i've got a little question. I'd like to create an object for example TextBox normaly it'd like look like this: TextBox my_Object = new TextBox(); but i'd like to get the name of the...
2
by: Andrés Giraldo | last post by:
Hi! I'm adding rows dinamically to a System.Web.UI.WebControls.Table, on depends on a dropdown listbox's selected item, on a Cell of the table I'm adding a TextBox, it's Text property it's a...
0
by: Development | last post by:
Hi Folks! Maybe some one can give me a hand with this problem: I'm building one asp.net page that reads data from the table and builds the table and the controls dinamically, I create a dataset...
4
by: Cesar Ronchese | last post by:
Hello. I have a WebForm that contains a Panel object. This panel, at design time is empty. When running, I need to create dinamically a Label and a WebControl (built from the same project). I...
32
by: Mateo | last post by:
I have char *array and it is dinamically alocated.... When I pass it to other function, I need to determine size of this array.... Problem: sizeof operator does not work with dinamically alocated...
3
by: valerio | last post by:
Hello all I would like to dinamically allocate an array of array of structures. To explain this: struct file{ char* fileName,int inode) myfiles; struct file{ char* fileName,int inode) mydirs; ...
4
by: George Ter-Saakov | last post by:
I am adding some functionality to HtmlInputText so i derived my class from it. The problem is when i switch page to desing mode the VS shows an error and do not render control. Unable to cast...
2
by: hmt | last post by:
How to create dinamically TextBox Array
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.