I have been searching for a way to insert linebreaks in my code for when I view my source. I am not looking for <br />
Something like the PHP equiv to \n
Any ideas on how to do this in ASP? I will be placing this inside a string.
I have been searching for a way to insert linebreaks in my code for when I view my source. I am not looking for <br />
Something like the PHP equiv to \n
Any ideas on how to do this in ASP? I will be placing this inside a string.
The best way is using
<br/>
tag like:In addition to the
\n
method, I have also embedded the HTML tag<BR>
and used:For me, using
"\n"
didn't work and resulted in\n
appearing as text on the webpage rather than as a newline in the source code view, however usingchr(10)
did work. UsingCrLf
was not an option for me as that generates a windows line ending (\r\n) and I needed the Linux line ending which is just the linefeed (\n).easiest way is just print html break line with response function
like this :
Response.Write "<BR>"
you can send any other HTML command as well with this method just watch for Quotation marksThere's no way to do it inside a string. You will have to append vbCrLf like so:
If you want to include it in the string, you could do a replace after like so: