Share via


HtmlHelper.AttributeEncode Method

Definition

Overloads

AttributeEncode(Object)

Converts the specified attribute value to an HTML-encoded string.

AttributeEncode(String)

Converts the specified attribute value to an HTML-encoded string.

AttributeEncode(Object)

Converts the specified attribute value to an HTML-encoded string.

public string AttributeEncode (object value);
member this.AttributeEncode : obj -> string
Public Function AttributeEncode (value As Object) As String

Parameters

value
Object

The object to encode.

Returns

The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string.

Applies to

AttributeEncode(String)

Converts the specified attribute value to an HTML-encoded string.

public string AttributeEncode (string value);
member this.AttributeEncode : string -> string
Public Function AttributeEncode (value As String) As String

Parameters

value
String

The string to encode.

Returns

The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string.

Applies to