IHtmlHelper.Encode Method

Definition

Overloads

Encode(Object)

Converts the value to an HTML-encoded String.

Encode(String)

Converts the specified String to an HTML-encoded String.

Encode(Object)

Source:
IHtmlHelper.cs

Converts the value to an HTML-encoded String.

C#
public string Encode (object value);

Parameters

value
Object

The Object to encode.

Returns

The HTML-encoded String.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Encode(String)

Source:
IHtmlHelper.cs

Converts the specified String to an HTML-encoded String.

C#
public string Encode (string value);

Parameters

value
String

The String to encode.

Returns

The HTML-encoded String.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0