2

The issue I am having is that when I create a multiline textbox, it prepends (carriage return line feed) characters.

I am using .NET 4.5. I created an empty project with just a multiline textbox:

<asp:TextBox ID="txtTest" runat="server" TextMode="MultiLine" Rows="5" Columns="50"></asp:TextBox>

In firefox and chrome it renders as:

<textarea name="txtTest" rows="5" cols="50" id="txtTest">&#13;&#10;</textarea> 

In IE, it is fine.

Thank you in advance.

Neil
  • 54,642
  • 8
  • 60
  • 72
Sean
  • 23
  • 3

3 Answers3

6

Like jmoreno suggested, changing

controlRenderingCompatibilityVersion=4.0

to

controlRenderingCompatibilityVersion=4.5

in web.config helped me.

Community
  • 1
  • 1
JTapp
  • 61
  • 1
  • 3
  • I was struggling with this issue for long as i was not able to find an solution or route cause of problem, just adding this in as solved issue. – Learning Aug 17 '20 at 06:06
  • You can even try to remove it, in this case it will default to the currently used .NET Framework. Which was 4.7 something in my case. – Marcel Dec 14 '21 at 13:09
3

this is fixed in .NET 4.5 RTM version. Are you using 4. RC? Connect issue fixed in RTM

Anand
  • 1,440
  • 8
  • 11
  • http://blogs.msdn.com/b/heaths/archive/2012/08/17/upgrading-from-visual-studio-2012-rc-to-rtm.aspx – Anand Oct 12 '12 at 18:13
  • Verified that the newest VS2012 RTM fixes the issues. Thanks! – Sean Oct 15 '12 at 16:41
  • note that there is a note on the Connect issue, pointing out that this if you use a controlRenderingCompatibilityVersion value less than 4.5. That may seem obvious, but it was what finally allowed me to fix the same issue. – jmoreno Dec 26 '14 at 18:44
1

The initial leading newline (LF or CRLF) of a textarea is ignored.

IE 8 and other older browsers (e.g. Firefox 3) remove the leading newline after parsing character entities.

However newer browsers removing the leading newline before parsing character entities, which then get interpreted as part of the default value of the textarea.

I don't know why .NET would generate those character entities.

Neil
  • 54,642
  • 8
  • 60
  • 72
  • Thank you for the explanation. I suppose it is a bug - those characters shouldn't be there and I'm not sure if I can do anything about it. – Sean Oct 10 '12 at 20:53