简体   繁体   English

ASP.NET文本框行消失

[英]ASP.NET text box lines disappear

when i try to dynamicly change the text of a textbox, if there is a line break, \\r\\n , all the text after the line break disappears including the line break sign. 当我尝试动态更改文本框的文本时,如果有换行符\\ r \\ n,则换行符之后的所有文本都会消失,包括换行符。 only single lines are updated correctly. 仅单行被正确更新。 the textbox is set to MultiLine TextMode. 文本框设置为MultiLine TextMode。

what could cause such behaviour ? 什么会导致这种行为?

You have to use vbCrLf for new lines. 您必须将vbCrLf用于新行。

Example : 范例:

TextBox1.Text = "First Line " & vbCrLf & "Second Line"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM