HtmlTextWriter.WriteStyleAttribute 方法

定义

将样式属性及其值写入到输出流。Writes a style attribute and its value to the output stream.

重载

WriteStyleAttribute(String, String, Boolean)

将指定的样式特性和值写入到输出流,如果指定了值,则还要对值进行编码。Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

WriteStyleAttribute(String, String)

将指定的样式属性写入到输出流。Writes the specified style attribute to the output stream.

WriteStyleAttribute(String, String, Boolean)

将指定的样式特性和值写入到输出流,如果指定了值,则还要对值进行编码。Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

public:
 virtual void WriteStyleAttribute(System::String ^ name, System::String ^ value, bool fEncode);
public virtual void WriteStyleAttribute (string name, string value, bool fEncode);
abstract member WriteStyleAttribute : string * string * bool -> unit
override this.WriteStyleAttribute : string * string * bool -> unit
Public Overridable Sub WriteStyleAttribute (name As String, value As String, fEncode As Boolean)

参数

name
String

要写入到输出流的样式属性。The style attribute to write to the output stream.

value
String

分配给样式属性的值。The value assigned to the style attribute.

fEncode
Boolean

若要对样式属性及其赋值进行编码,则为 true;否则为 falsetrue to encode the style attribute and its assigned value; otherwise, false.

注解

WriteStyleAttribute方法按以下形式写入样式特性:The WriteStyleAttribute method writes the style attribute in the following form:

name = value ;name = value ;

方法用于对value参数进行编码。 HtmlAttributeEncodeThe HtmlAttributeEncode method is used to encode the value parameter.

另请参阅

WriteStyleAttribute(String, String)

将指定的样式属性写入到输出流。Writes the specified style attribute to the output stream.

public:
 virtual void WriteStyleAttribute(System::String ^ name, System::String ^ value);
public virtual void WriteStyleAttribute (string name, string value);
abstract member WriteStyleAttribute : string * string -> unit
override this.WriteStyleAttribute : string * string -> unit
Public Overridable Sub WriteStyleAttribute (name As String, value As String)

参数

name
String

要写入到输出流的样式属性。The style attribute to write to the output stream.

value
String

分配给样式属性的值。The value assigned to the style attribute.

注解

WriteStyleAttribute方法按以下形式写入样式特性:The WriteStyleAttribute method writes the style attribute in the following form:

name = value ;name = value ;

另请参阅

适用于