asp Lable does not wrap at new line.

  • Thread starter Thread starter Nalaka
  • Start date Start date
N

Nalaka

Hi
I am showing a text paragraph in a labe control.

But, the label control is ignoring my "newLines".... (newline+carraige
return)
( I correct this paragraph using a multiline textBox)

how do I get the label to go to a new line at line breaks?


Thanks
Nalaka
 
Use <br> instead. Remember, the contents of the label are entirely
interpreted by the browser which ignores whitespace.
 
thanks... this worked...


Peter Rilling said:
Use <br> instead. Remember, the contents of the label are entirely
interpreted by the browser which ignores whitespace.
 
For the record <br> (and <br/>) are depreated. Their use should never
be considered. Don't expect application taht use that to work in 5
years.
 
You can't think of pages having "line breaks", you rather you need to
think of the line in it's full context. Is it a statement of some
sort? Statements go into paragraphics... ergo...

<p><asp:Label id="lblMyStuff" runat="server="></asp:Label></p>

<br> is deprecated as is <font>, table hacks, frame hacks, iframe
hacks, the style attribute and many other things.
 
Boy, aren't you the optimist. I believe that the reality will be that these
will never go away as long as HTML is used. The reason is that there are
too many sites that depend on these tags and hacks and so if a browser was
suddenly released such that proper standards were enforced, it would
probably break about 60% of the sites out there resulting in people not
wanting to use the browser.
 
Hi,
well, what I have is a multline textbox that user enters a comment.
In a text box user have the ability to hit "enter" and go to the new line.

So... when I show the comment, later, on a separate page...
I need to show in the same format as the user entered.. with line breaks.
if not the output looks ugly (not what the writer intended).

That is why I was looking for a way to duplicate the texBox effect on the
label.

Nalaka
 

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

Back
Top