【发布时间】:2011-09-13 19:58:34
【问题描述】:
我正在创建一个自定义服务器控件,其属性接受字符串作为输入。处理空格/制表符和换行符的正确方法是什么?例如,
<prefix:MyControl runat="server"
Property="This is a long text string which is manually
wrapped in the VS text editor on multiple
lines."
>
</prefix:MyControl>
这会返回类似于
的内容"这是一个长文本字符串 手动\r\n 包裹在 VS 文本中 多个编辑器\r\n 行。”
是否有一个特殊的属性可以应用于属性来帮助解决这个问题?我已经检查了Metadata Attributes for Custom Server Controls 还是我需要手动去除换行符和额外的间距?
【问题讨论】:
标签: asp.net string properties whitespace custom-server-controls