Literal and linebreak

  • Thread starter Thread starter Per W.
  • Start date Start date
P

Per W.

Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.

/Per W.
 
Per W. said:
Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.

Could you try asking your question again in a different way? I'm not
entirely sure I understand. On the other hand, if you mean can you have
a string literal which includes linebreaks, then it definitely depends
on your language (at least in terms of how you do it).

In C#, for instance, you could use:

string verbatimLiteral = @"This text
is on
multiple lines";

or:

string normalLiteral = "This text\r\nhas linebreaks\r\nembedded";
 
Jon Skeet said:
Could you try asking your question again in a different way? I'm not
entirely sure I understand. On the other hand, if you mean can you have
a string literal which includes linebreaks, then it definitely depends
on your language (at least in terms of how you do it).

In C#, for instance, you could use:

string verbatimLiteral = @"This text
is on
multiple lines";

or:

string normalLiteral = "This text\r\nhas linebreaks\r\nembedded";

Its VB. The only place i got linebreak from a textfile to work is in
textbox, in literal or a cell in a table i dont get the linebreaks. I read a
file with
My.Computer.FileSystem.ReadAllText(memolabel.Text,
System.Text.Encoding.ASCII)

/Per W.
 
Its VB. The only place i got linebreak from a textfile to work is in
textbox, in literal or a cell in a table i dont get the linebreaks. I read a
file with
My.Computer.FileSystem.ReadAllText(memolabel.Text,
System.Text.Encoding.ASCII)

/Per W.

Per, this is not a purely ASP.NET newsgroup! Please tell people if you're
asking about WinForms or ASP.NET or most will assume WinForms.

A newline is represented by a <br> in a Literal, just as it is in any HTML.

Cheers,
Gadget
 
Back
Top