List

S

shapper

Hello,

I created a list as follows:

Dim errors As New List(Of String)

Now I added the errors simply by doing so:

errors.Add(error)

Now I need to display all items in this list, in different lines, in a
label:

error1

error2

error3

....

I believe I should loop through each item and create a string.

Between each item I would add a <br /> and use & to add a new error to
the existing string.

Then I would make MyLabel.Text = MyString.

Is this the best way?

Should I use a StringBuilder?

Is there a different way to do this?

I am asking this because I am having problems with the change line
process.

Thanks,

Miguel
 
K

Karl Seguin [MVP]

I'd use a repeater.

If you absolutely need the value in a label (why?) then yes, you should use
a stringbuilder.

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top