• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1313
  • Last Modified:

Writing a "newline" in "text/plain". asp.net 2.0

I'm writing some asp code that is manually displaying some text on a page withought all the <html><body> tags, etc. I can't figure out how to tell it to go down a line. I need to display it like this:
My Name
Phone number
Not like this:
My NameAddressPhone number
HTML tags cannot be used here since I need the source html code to contain nothing but the raw data text (no tags). thanks, Chris.
1 Solution
Jaime OlivaresSoftware ArchitectCommented:
use "\r\n" combination instead of "<br>" or "<p>"
Note that \r\n is correct for Windows encodings, but \n is correct for Unix (i.e. Linux and Mac) encodings.  It matters what encoding you use in the HTTP headers, not just text/plain.

\r is the Carriage Return character and has a hex code of 0D
\n is the New Line character and has a hex code of 0A

Both have the same codes in UTF-8, and are one byte long.
b0lsc0ttIT ManagerCommented:

This is done with vbcrlf.  It is a constant in ASP (vbscript) that will insert a carriage return character and a line feed character.

Let me know if you have any questions or need more information.

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

b0lsc0ttIT ManagerCommented:

In other languages (e.g. PHP, Javascript, etc) the method is \r\n or just \n in the script.

Let me know if you have a question.

jumpstart0321Author Commented:
b0lsc0ttIT ManagerCommented:
I'm glad I could help.  Thanks for the grade, the points and the fun question.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now