Need a new line in my label tag

M

moni

Hi,

I am getting a label to display data on page load after retreiving
from the SQL server. But I need to display many values, so I am
concatenating a string value and then using a label to display it.

totalMessage = (string)dreader1.GetValue(2);
totM += totalMessage + "\n";
Label8.Visible = true;
Label8.Text =totM;

But I am not getting the values on seperate lines. What may I have to
do for that?

Any help will be appreciated. Thanks alot!
 
M

Mark Rae

I am getting a label to display data on page load after retreiving
from the SQL server. But I need to display many values, so I am
concatenating a string value and then using a label to display it.

totalMessage = (string)dreader1.GetValue(2);
totM += totalMessage + "\n";
Label8.Visible = true;
Label8.Text =totM;

But I am not getting the values on seperate lines. What may I have to
do for that?

Any help will be appreciated. Thanks alot!

Change "\n" to "<br />"
 
M

Mark Fitzpatrick

You're using a \n, which is the escape character for a string. That's fine
for the string, but that means absolutely nothing to the browser. The the
web browser that's just whitespace. You'll need to concatenate an HTML
linebreak instead of a string linebreak. Try "<br />" instead.
 

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
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top