Solved

Arraylist to textbox in web form

Posted on 2007-11-17
3
755 Views
Last Modified: 2012-05-05
I am trying to figure out how to copy an arraylist to a textbox in a web form... I figured out how to do it with a windows form using textbox.AppendText in a foreach, but I cannot use AppendText in the web form...  thanks for the help!
0
Comment
Question by:brassmon
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 total points
ID: 20306616
Use a StringBuilder to create the string:
StringBuilder builder = new StringBuilder();
foreach (object o in theArrayList) {
   builder.AppendLine(o.ToString());
}
theTextBox.Text = builder.ToString();

Open in new window

0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20306620
something like this:

StringBuilder sb = new StringBuilder();
foreach (object o in yourList)
{
      sb.Append(o);
      sb.Append(" ");
}
textbox.Text = sb.ToString();
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20306624
Sorry, not refreshed...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question