Multi-line textbox looses leading line-break - by Richard Deeming

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 359023 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/31/2008 5:58:25 AM
Access Restriction Public


A multi-line TextBox or HtmlTextArea with a value which starts with one or more line-breaks looses the first line break on post-back.
Sign in to post a comment.
Posted by Microsoft on 7/15/2009 at 2:59 PM
Hi Richard, we have fixed this issue. You will see the fix first appear in ASP.NET 4 Beta 1.
Posted by Microsoft on 8/1/2008 at 1:26 AM
Thanks for your feedback. We are escalating this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team
Posted by Richard Deeming on 7/31/2008 at 6:06 AM
I have uploaded a sample file. Load the "TestLineBreak.aspx" page, and click the button. Each time you click the button, the text will move up one line.

Internet Explorer, Firefox and Opera all ignore the first line break after the textarea tag, unless it is preceded by another character. For example, if the text is set to " \n\n\nText" (a single space before the line break), the text doesn't move up.

The solution seems to be to render an extra line break before the value of the control if the value starts with a CR or LF.