Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPEncode.HtmlEncode method

Encodes the specified string so that special characters used in HTML are encoded as HTML entities.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static string HtmlEncode(
	string str


Type: System.String

The string to encode.

Return value

Type: System.String
The encoded version of the string that is passed to the method.

The HtmlEncode method converts characters to entities as follows:

  • < to &lt;

  • > to &gt;

  • & to &amp;

  • " to &quot;

  • ' to &#39;

© 2015 Microsoft