Need a new line in my label tag

  • Thread starter Thread starter moni
  • Start date Start date
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!
 
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 />"
 
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.
 
Back
Top