HtmlTextWriter.AddStyleAttribute Method (String, String, HtmlTextWriterStyle)

Adds the specified markup style attribute and the attribute value, along with an HtmlTextWriterStyle enumeration value, to the opening markup tag created by a subsequent call to the RenderBeginTag method.

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

protected:
virtual void AddStyleAttribute (
	String^ name, 
	String^ value, 
	HtmlTextWriterStyle key
)
protected void AddStyleAttribute (
	String name, 
	String value, 
	HtmlTextWriterStyle key
)
protected function AddStyleAttribute (
	name : String, 
	value : String, 
	key : HtmlTextWriterStyle
)
Not applicable.

Parameters

name

A string that contains the style attribute to be added.

value

A string that contains the value to assign to the attribute.

key

An HtmlTextWriterStyle that represents the style attribute to add.

Use the AddStyleAttribute overload of the AddStyleAttribute(String,String,HtmlTextWriterStyle) method only when inheriting from the HtmlTextWriter class. It enables you to create new name and value pairs for HtmlTextWriterStyle attributes.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: