Solved

Arraylist to textbox in web form

Posted on 2007-11-17
3
746 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now