Share via


HtmlHelper.Encode Method (Object)

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

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Function Encode ( _
    value As Object _
) As String
'Usage
Dim instance As HtmlHelper 
Dim value As Object 
Dim returnValue As String 

returnValue = instance.Encode(value)
public string Encode(
    Object value
)
public:
String^ Encode(
    Object^ value
)
member Encode : 
        value:Object -> string
public function Encode(
    value : Object
) : String

Parameters

Return Value

Type: System.String
An HTML-encoded string that represents the object.

Remarks

To facilitate encoding, the specified object is first converted to an unencoded string by calling its ToString method with the InvariantCulture enumeration. This string representation of the object is then encoded and returned.

See Also

Reference

HtmlHelper Class

Encode Overload

System.Web.WebPages.Html Namespace