Solved

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

Posted on 2007-11-23
6
1,296 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

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.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

823 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