Partager via


HtmlHelper.Encode Method

Include Protected Members
Include Inherited Members

Converts the specified value to an HTML-encoded string.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method Encode(Object) Converts the value of the specified object to an HTML-encoded string.
Public method Encode(String) Converts the specified string to an HTML-encoded string.

Top

Remarks

If characters such as spaces and punctuation are passed in an HTTP stream, they can be misinterpreted when they are processed. URL encoding converts characters that are not allowed in a URL into character-entity equivalents. For example, when the characters < and > are embedded in a block of text to be transmitted in a URL, they are encoded as %3c and %3e.

See Also

Reference

HtmlHelper Class

System.Web.Mvc Namespace