screenshot

HtmlAttributeEncode

The HtmlAttributeEncode method encodes characters appropriate for insertion into an HTML attribute value.

The string result from the HtmlAttributeEncode method should be used only for double-quoted attributes. Security issues might arise when using the HtmlAttributeEncode method with single-quoted attributes.

HtmlEncode

Converts a string into an HTML-encoded string.

To encode or decode values outside of a web application, use the WebUtility class.

UrlEncode

Encodes a URL string. These method overloads can be used to encode the entire URL, including query-string values.

To encode or decode values outside of a web application, use the WebUtility class.

JavaScriptStringEncode

This method encodes strings. For instance, single quotation marks and double quotation marks are included as \' and \" in the encoded string.

Links