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

Writting to a TextBox

I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?

Nov 8 '06 #1
5 5853
"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
>I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?
Enumerate the list, forming a string from the names (using whatever
delimiters, if any, you desire of course), and then set the text of the
TextBox to that string.
Nov 8 '06 #2
The best way to enumerate the list is:
string[] names = (string[])list.ToArray(typeof(string));
textbox1.Text = string.Join("\r\n",names);
Ciaran O'Donnell
"Peter Duniho" wrote:
"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?

Enumerate the list, forming a string from the names (using whatever
delimiters, if any, you desire of course), and then set the text of the
TextBox to that string.
Nov 9 '06 #3
Or
object[] names = list.ToArray();
string.Concat(names);

this might be better because the arraylist doesnt copy the internal array
for this but the string.concat does a bit more work. This would use less
memory though.

Ciaran O'Donnell

"Peter Duniho" wrote:
"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?

Enumerate the list, forming a string from the names (using whatever
delimiters, if any, you desire of course), and then set the text of the
TextBox to that string.
Nov 9 '06 #4
Scrub this one, the ToArray() does copy the array so the other one is better.

"Ciaran O''Donnell" wrote:
Or
object[] names = list.ToArray();
string.Concat(names);

this might be better because the arraylist doesnt copy the internal array
for this but the string.concat does a bit more work. This would use less
memory though.

Ciaran O'Donnell

"Peter Duniho" wrote:
"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
>I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?
Enumerate the list, forming a string from the names (using whatever
delimiters, if any, you desire of course), and then set the text of the
TextBox to that string.

Nov 9 '06 #5
Thanks to everyone for the help. It works
Ciaran O''Donnell wrote:
Scrub this one, the ToArray() does copy the array so the other one is better.

"Ciaran O''Donnell" wrote:
Or
object[] names = list.ToArray();
string.Concat(names);

this might be better because the arraylist doesnt copy the internal array
for this but the string.concat does a bit more work. This would use less
memory though.

Ciaran O'Donnell

"Peter Duniho" wrote:
"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I want to create an ArrayList of names ("Tony","Robin","Johnson") on
one page and then on another page I want to populate a TextBox field
with those names from the Arraylist. How do I populate the TextBox?
>
Enumerate the list, forming a string from the names (using whatever
delimiters, if any, you desire of course), and then set the text of the
TextBox to that string.
>
>
>
Nov 9 '06 #6

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

Similar topics

0
by: Hai Nguyen | last post by:
Hi everyone I'm writting a javascript for my validators. Some of them will be validated or server side, some of them will be validated on client side. Since I don't want to mix my javascript...
2
by: John Carnahan | last post by:
I have a problem writing the text from a multi-line textbox to the Sql Server db. If the user sends a vbcrlf (enter key) in the middle of the entered text, the text gets truncated at the vbcrlf...
6
by: Raed Sawalha | last post by:
Hello: I have a textbox which let user key in time.. sample of data: 06:00 AM 9:15 PM User only can key in the 12 hour format. how to write the Regular Expression for such input? Thanks!!!!
1
by: Feng | last post by:
I have an ASP.Net app that is wrtting some log information into a log file. All I have is one single log file used by the web application and shared cross all the sessions. What I don't understand...
6
by: noridotjabi | last post by:
Is there any way in C to write source which would make an executable that excepted modifications. For instance say we have modable program that excepts plugins. That starts with a menu. 1)Add...
1
by: itsjyotika | last post by:
Hello Everyone, I need to read data from a CVS file(i created it from micosoft excel) and then need to match it with the one of the date from the command line.If the date is there then it should say...
6
by: Java1963 | last post by:
Need help with writting an application that prompt for and read a double value representing a monetary amount. -------------------------------------------------------------------------------- ...
1
by: rahulbsbs | last post by:
Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be...
0
by: marinhof | last post by:
hi i need some guidance.. this is the situation im working on web app using Visual studio 2003 working with C# and asp.net the database is managed by sql studio managmnet 2005.. the thing is i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.