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)

Syntax

'Declaration
Public Shared Sub WriteHtmlEncode ( _
    response As HttpResponse, _
    str As String _
)
'Usage
Dim response As HttpResponse
Dim str As StringSPEncode.WriteHtmlEncode(response, str)
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