SPEncode.WriteHtmlEncode Method

Encodes the specified string so that characters in embedded HTML tags are displayed as text in the browser, and writes the string to the HTTP output content stream.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)> _
Public Shared Sub WriteHtmlEncode ( _
    response As HttpResponse, _
    str As String _
)
'Usage
Dim response As HttpResponse
Dim str As StringSPEncode.WriteHtmlEncode(response, str)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)]
public static void WriteHtmlEncode(
    HttpResponse response,
    string str
)

Parameters

Remarks

The WriteHtmlEncode method converts characters that could be confused with HTML tags to entities. For example, "<" is converted to "&lt;".

This method replaces multiple spaces in the string with a single space.

See Also

Reference

SPEncode Class

SPEncode Members

Microsoft.SharePoint.Utilities Namespace