HtmlTextWriter.Write Method (String, Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Writes a tab string and a formatted string to the output stream, using the same semantics as the String.Format method, along with any pending tab spacing.

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

public override void Write(
	string format,
	object arg0
)

Parameters

format
Type: System.String

A string that contains zero or more format items.

arg0
Type: System.Object

An object to format.

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 a formatted string with the value of the CurrentCulture property.

// Use the Write(string, object) method to
// render a formatted string and an object in it.
writer.RenderBeginTag(HtmlTextWriterTag.Label);
writer.Write("The current cultural settings are {0}",
    CultureInfo.CurrentCulture);
writer.RenderEndTag();

.NET Framework
Available since 1.1
Return to top
Show: