Share via


HtmlHelper.Encode Method

Definition

Overloads

Encode(String)

Returns an HTML-encoded string that represents the specified string by using a full encoding that is suitable for arbitrary HTML.

Encode(Object)

Returns an HTML-encoded string that represents the specified object by using a full encoding that is suitable for arbitrary HTML.

Encode(String)

Returns an HTML-encoded string that represents the specified string by using a full encoding that is suitable for arbitrary HTML.

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

Parameters

value
String

The string to encode.

Returns

An HTML-encoded string that represents the original string.

Applies to

Encode(Object)

Returns an HTML-encoded string that represents the specified object by using a full encoding that is suitable for arbitrary HTML.

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

Parameters

value
Object

The object to encode.

Returns

An HTML-encoded string that represents the object.

Applies to