tags:

views:

1128

answers:

3

Hey All, I have been searching for a way to insert linebreaks in my code for when I view my source. I am not looking for

Something like the PHP equiv to \n

Any ideas on how to do this in ASP? I will be placing this in side a string.

Thanks,

Ryan

A: 

New Line Character in ASP

maxnk
+2  A: 

There's no way to do it inside a string. You will have to append vbCrLf like so:

Response.Write "hello" & vbCrLf & "world"

If you want to include it in the string, you could do a replace after like so:

output = "hello\nworld"
output = Replace(output, "\n", vbCrLf)
Response.Write output
John Sheehan
Perfect...thanks JohnRyan
Coughlin
On a side note, in ASP.NET you'll want to use Environment.NewLine instead.
R. Bemrose
+1  A: 

In addition to the \n method, I have also embedded the HTML tag <BR> and used:

Response.Write "First Line Of Text<br>Second Line Of Text<br>Third line Of Text"
Optimal Solutions