---
title: "Multiline TextBox multiple newline"  
description: "Multiline TextBox multiple newline"  
author: "Anonymous User"  
published: 2013-09-03  
updated: 2013-09-03  
canonical: https://www.mindstick.com/forum/1424/multiline-textbox-multiple-newline  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# Multiline TextBox multiple newline

I set [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) a [multiline](https://www.mindstick.com/interview/103/what-s-the-difference-between-comments-comments-and-comments) [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) like this.

textBox1.Text = "Line1\r\n\r\nLine2";

But, only [one line](https://www.mindstick.com/forum/159096/how-can-i-run-two-commands-in-one-line-in-windows-cmd) [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space) in output.

When I read the value of textbox, I read "Line1\r\nLine2";

Why [ASP.NET](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) not [support](https://yourviews.mindstick.com/view/286/modi-support-for-sportsperson) more then one lineline [character](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character)?

Any help will be appreciated.

## Replies

### Reply by Sumit Kesarwani

Hi Jeet,\

You need to set the textbox to be multiline, this can be done two ways:

## In the control:

```
<asp:TextBox runat="server"
ID="MyBox" TextMode="MultiLine" Rows="10" />
```

## Code Behind:

MyBox.TextMode = TextBoxMode.MultiLine;

MyBox.Rows = 10;

This will render as a <textarea>


---

Original Source: https://www.mindstick.com/forum/1424/multiline-textbox-multiple-newline

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
