.NET Framework Class Library
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.
Assembly: System.Web (in System.Web.dll)
Syntax
Visual Basic
Protected Overridable Sub AddStyleAttribute ( _ name As String, _ value As String, _ key As HtmlTextWriterStyle _ )
C#
protected virtual void AddStyleAttribute( string name, string value, HtmlTextWriterStyle key )
Visual C++
protected: virtual void AddStyleAttribute( String^ name, String^ value, HtmlTextWriterStyle key )
F#
abstract AddStyleAttribute : name:string * value:string * key:HtmlTextWriterStyle -> unit override AddStyleAttribute : name:string * value:string * key:HtmlTextWriterStyle -> unit
Parameters
- name
- Type: System.String
A string that contains the style attribute to be added.
- value
- Type: System.String
A string that contains the value to assign to the attribute.
- key
- Type: System.Web.UI.HtmlTextWriterStyle
An HtmlTextWriterStyle that represents the style attribute to add.
Remarks
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.
Version Information
.NET Framework
Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also