MULTILINE TEXTBOX MULTIPLE NEWLINE

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
WPF 
WPF
 1279  View(s)
Ratings:
Rate this:

I set value a multiline textbox like this.

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

But, only one line space in output.

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

Why ASP.NET not support more then one lineline character?

Any help will be appreciated.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: Multiline TextBox multiple newline

    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>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!