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.
这篇关于多行文本框多个换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:多行文本框多个换行符
基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
