XhtmlTextWriter.WriteBreak Method

Definition

Writes a <br/> element to the XHTML output stream.

C#
public override void WriteBreak();

Examples

The following code example demonstrates how to override the inherited HtmlTextWriter.BeginRender method to write a text string with the HtmlTextWriter.Write method and a <br/> element with the WriteBreak method.

C#
// Override the BeginRender method to write a
// message and call the WriteBreak method
// before a control is rendered.
override public void BeginRender()
{
   this.Write("A control is about to render.");
   this.WriteBreak();
}

// Override the EndRender method to
// write a string immediately after 
// a control has rendered. 
override public void EndRender()
{
   this.Write("A control just rendered.");
}

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1