HtmlTextWriter.WriteBreak 方法

定义

<br /> 标记元素写入到输出流。

public:
 virtual void WriteBreak();
public virtual void WriteBreak ();
abstract member WriteBreak : unit -> unit
override this.WriteBreak : unit -> unit
Public Overridable Sub WriteBreak ()

示例

下面的代码示例演示如何在WriteBreak方法写入编码&lt;custID&gt; &amp; &lt;invoice#&gt;标记后WriteEncodedText调用方法以将元素写入<br />请求浏览器。

// Assign a value to a string variable,
// encode it, and write it to a page.
colHeads = "<custID> & <invoice#>"; 
writer.WriteEncodedText(colHeads);
writer.WriteBreak();
' Assign a value to a string variable,
' encode it, and write it to a page.
colHeads = "<custID> & <invoice#>" 
writer.WriteEncodedText(colHeads)
writer.WriteBreak()

注解

使用 WriteBreak 此方法在自定义控件或适配器标记中呈现换行符。 该方法WriteBreak为改进的 HTML 兼容性编写空格br``/

适用于

另请参阅