[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Response.Write with \n problem

Posted on 2004-11-24
1
Medium Priority
?
205 Views
Last Modified: 2006-11-17
Hi Experts,

I use this method in my class like this:
System.Web.HttpContext.Current.Response.Write("Message1"+"\n");
System.Web.HttpContext.Current.Response.Write("Message2"+"\n");

I want the result to be displayed like this:
Message1
Message2
But it is displayed like this:
Message1 Message2

???

Thanks in advance for your answers.
0
Comment
Question by:noulouk
1 Comment
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 2000 total points
ID: 12664791
You need to use:

System.Web.HttpContext.Current.Response.Write("Message1"+"<br/>");
System.Web.HttpContext.Current.Response.Write("Message2"+"<br/>");

To HTML, a new line is just white space that it ignores.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

873 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