HttpUtility.HtmlEncode Method
.NET Framework (current version)
Converts a string into an HTML-encoded string.
To encode or decode values outside of a web application, use the WebUtility class.
Assembly: System.Web (in System.Web.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | HtmlEncode(Object) | Converts an object's string representation into an HTML-encoded string, and returns the encoded string. |
![]() ![]() | HtmlEncode(String) | Converts a string to an HTML-encoded string. |
![]() ![]() | HtmlEncode(String, TextWriter) | Converts a string into an HTML-encoded string, and returns the output as a TextWriter stream of output. |
Show:

