ASP.NET: New Line with Response.Write

Scenario

I want to add a line line using Response.Write() function in the code behind page aspx.cs

Solution

If you’re implementing this on ASP then presumably you’re outputting the text to a web page. That means that text formatting is achieved by injecting HTML into the text stream.

The HTML for a newline is <br />

So try:

Response.Write(“Line : 1<br />Line : 2”);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s