Multiline TextBox multiple newline(多行文本框多个换行符)
问题描述
我像这样为 Multiline Textbox
设置了一个值.
I set a value for a Multiline Textbox
like this.
textBox1.Text = "Line1
Line2";
但是,输出中只有一个行距.
But, only one line space in output.
当我读取文本框的值时,我读取了 "Line1
Line2"
;
When I read the value of textbox, I read "Line1
Line2"
;
为什么 ASP.NET 不支持多于一个的换行符?
Why does ASP.NET not support more then one lineline character?
推荐答案
我也遇到了同样的问题.如果我添加一个 Environment.Newline 我会在文本框中得到一个新行.但是如果我添加两个 Environment.Newline 我会得到一个新行.在我的网络应用程序中,我使用了一个空格模块来删除所有不必要的空格.如果我禁用此模块,我的文本框中会出现两行新行.希望对您有所帮助.
I had the same problem. If I add one Environment.Newline I get one new line in the textbox. But if I add two Environment.Newline I get one new line. In my web app I use a whitespace modul that removes all unnecessary white spaces. If i disable this module I get two new lines in my textbox. Hope that helps.
这篇关于多行文本框多个换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:多行文本框多个换行符


- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- 使用 rss + c# 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01