Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb.net web application

Status
Not open for further replies.

tek2002

Programmer
Aug 21, 2001
67
0
0
US
I have a question about carriage returns.

txtOutput.text = "1" & vbcrlf & "2" & vbcrlf & "3"

When i use the above code in a vb.net web application,
the output is displayed in 1 line: 123 instead of
the expected 3 lines:
1
2
3

I tried to use &quot;<br/>&quot; as it works with c# web applications but it does not work here....not sure if i should post this in the asp.net forum.

Can anyone tell me what i should do to have the output diplayed over more than 1 line.

Thanks

 
try this:

txtOutput.Text = &quot;1<br>2<br>3<br>&quot;

It should produce the following:

1
2
3

Just remember the output is HTML, so you can use <br> or <p>, or whatever formatting tags or style you like.
 
does not work.

in webform1.aspx.vb
in an event handler for a command button, i placed

txtOutput.text = &quot;1<br>2<br>3<br>&quot;

and when i build and run, i get:

1<br>2<br>3<br>
 
It appears you are using a TextBox anyways, and not a label...so html wouldn't work in it.

Try using Chr(13) and see how that goes.
 
Does Not Work.

txtOutput.text = &quot;1&quot; & chr(13) & &quot;2&quot; & chr(13) & &quot;3&quot;
Produces: 123

for a label, chr(13) translates into a space:
1 2 3

for a label <br> translates into carriage return like u said:
1
2
3

Nothing seems to work for a text box....help
 
OMG - i cant believe that i overlooked that...urrghhh

thanks so much -> vbcrlf and chr(13) works perfect if you have textmode property set to multiline.

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top