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)


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

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


Return Value

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


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


HtmlHelper Class

Encode Overload

System.Web.WebPages.Html Namespace