HtmlTextWriter.Write Method (Object)

 

Writes the text representation of an object to the output stream, along with any pending tab spacing.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public override void Write(
	object value
)

Parameters

value
Type: System.Object

The object to write to the output stream.

The Write method generates any tabs that are pending, and then calls the Write base method.

The following code example shows how to use the Write method to render the value of the CultureInfo.CurrentCulture property.

This code example generates the following markup:

This is a rendered CultureInfo object.

<bold>

The value of the CurrentCulture property:

</bold>

// Use the Write method to render an arbitrary
// object, in this case a CultureInfo object. 
writer.Write("This is a rendered CultureInfo Object.");
writer.RenderBeginTag(HtmlTextWriterTag.B);
writer.Write(CultureInfo.CurrentCulture);
writer.RenderEndTag();

.NET Framework
Available since 1.1
Return to top
Show: