文本区域不显示在IE换行符 [英] Textarea doesn't show newline in IE

查看:179
本文介绍了文本区域不显示在IE换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来像IE忽略\\ r \\ n的文本时文本放置到一个textarea。下面是它的外观在FF /铬/歌剧

Looks like IE ignores \r\n in text when the text is placed into a textarea. Here's how it looks in FF/Chrome/Opera:

Paragraph1 sometext
Paragraph2 othertext

和在IE7 / 8:

Paragraph1 sometextParagraph2 othertext

我试图改变新线的CSS参数没有运气。任何想法可能是错误的?

I tried changing "new-line" css parameter with no luck. Any ideas what might be wrong?

我用asp.net作为后端,在这里我分配一个文本textarea的,但我怀疑这是相关的。

I use asp.net as back end, where I assign that text to the textarea, but I doubt it's relevant.

更新:好像它是asp.net正在呈现的asp:文本不同的不同的浏览器 - IE浏览器似乎忽略换行符。当我更换ASP:TextBox控件以及textarea的,我得到正确的结果。任何想法如何解决呢?

UPDATE: Seems like it's asp.net that is rendering asp:TextArea differently for different browsers - for IE it seems to ignore newline characters. When I replace asp:TextBox with textarea, I get correct results. Any ideas how to fix that?

推荐答案

原来,我的问题无关的textarea的本身,而是与办法,我逃避输出非转义输入。我将打开另一个问题了这一问题。

Turns out that my problem has nothing to do with the textarea itself, but rather with the way I'm escaping the output and unescaping the input. I'll open another question for that problem.

这篇关于文本区域不显示在IE换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆