Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2007-11-23
6
1,298 Views
Last Modified: 2013-11-07
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
Address
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.
0
Comment
Question by:jumpstart0321
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20341926
use "\r\n" combination instead of "<br>" or "<p>"
0
 
LVL 19

Expert Comment

by:SteveH_UK
ID: 20342001
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.
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 20342053
jumpstart0321,

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.

b0lsc0tt
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20342055
jumpstart0321,

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.

b0lsc0tt
0
 

Author Closing Comment

by:jumpstart0321
ID: 31410752
GREAT JOB!!!:)
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20342069
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question