473,395 Members | 2,798 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,395 software developers and data experts.

Capturing Data of Dynamically Created TextBox's

Hi there,

I am dynamically created a table at runtime on an aspx form. The last
cell of each row contains a TextBox in which the user will enter
numeric values into.

Each textbox I create is given a name such as myTextBox0, myTextBox1,
... etc Basically the index of the loop that creates the table is
appended to the end of each TextBox name (ID).

My Problem:

How do I capture the values in each text box once the user continues
(click button) to the next screen??

If you could possibily post me an example of how to do this I would be
most grateful.

Thanks in advance.
Nov 17 '05 #1
5 3661
how do you move to the next page ?
if you use Server.Transfer you can use the Form collection:
Form["myTextBox0"]

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

No I just have a button and within the button event I attempt to capture
the values. Can you please be more specific?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
On the same page ? by using the controls ID (just dont forget to
recreate them on post back) and the FindControl method :

string x = ((TextBox)this.FindControl("mytextbox1")).Text;

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4

but on postback isn't everything recreated? so the values within the
text box will be wiped?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #5
Yes, every thing recreated but the asp.net smart enough to change the
text box value to the value submitted from the client.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6

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

Similar topics

3
by: crjunk | last post by:
I have a web page that displays multiple records for a company. The input text boxes that display my data are created dynamically. I'm creating these input boxes dynamically because the number of...
2
by: utterberg | last post by:
Can anyone help me with this problem? I dynamically creates several textboxes using a placeholder. This works fine. But is there a way for me to loop through theese textboxes and retrive its value...
2
by: JaM | last post by:
Hi all, I have created a gridview vith dynamic textbox columns (they are in variable number, it depends on what things I select from database) aspx code:...
0
by: Silver Oak | last post by:
I have a DataGrid in which one of the columns is TemplateColumn that was created dynamically using iTemplate. I would like to have multi-row editing capability on the DataGrid. I'm trying to...
2
by: HHAAPPYY | last post by:
Hi I am trying to pass value of the textbox along with another value to the query string. when i am retriving the txtbox value it always shows me null, my senario is like this On my...
3
by: raghulvarma | last post by:
I have created only one object for the textbox and that particular textbox is being repeated as many times I want.But if I want to add the values in the database from each and every textbox which...
4
by: Jeannot | last post by:
VS2008, VB, .NET 3.5 When I create a TextBox in Designer, then at runtime wherever I click, the caret is placed at the end of the text the box actually contains. But when I create a TextBox...
4
by: pooja8389 | last post by:
Good evening.. how can i save the value of dynamically created textbox in data base using System; using System.Data; using System.Configuration; using System.Collections; using...
12
by: pooja8389 | last post by:
good evening... how can store the text value of dynamically created textbox in database. using System; using System.Data; using System.Configuration; using System.Collections; ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.