Connecting Tech Pros Worldwide Forums | Help | Site Map

Displaying data on a new Line of Label with c#

Member
 
Join Date: Dec 2007
Posts: 73
#1: Oct 10 '08
I have a Label that i am cntinuously adding data to i would like to add the Data to a new line with in the label is there any way of doing this with c# and on an asp.net page?

shweta123's Avatar
Expert
 
Join Date: Nov 2006
Location: India,Pune
Posts: 686
#2: Oct 10 '08

re: Displaying data on a new Line of Label with c#


Hi,

Please read This regarding your problem.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#3: Oct 10 '08

re: Displaying data on a new Line of Label with c#


Use a line break character if you need a new line.
A Label is just a <SPAN> html object, so you could use the <br/> line break for html
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,131
#4: Oct 10 '08

re: Displaying data on a new Line of Label with c#


When you're adding the data to your label add the String "<br />".

<br /> is html that tells the browser to enter a new line.

-Frinny

<edit>
Oh I didn't notice that Plater already made this recommendation :)
The only thing is that you cannot use HtmlEncode if you are inserting HTML into your labels like this....
</edit>
Reply