Solved

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

Posted on 2007-11-23
6
1,295 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Class object 2 27
C# HTTP GET method sample code 3 42
VB.NET Repostiory Pattern 7 17
Visual Studio 2013 and Eclipse Neon 6 8
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now