HttpUtility.HtmlEncode Method (String, TextWriter)
Encodes the specified string as a text string to be enclosed in HTML tags, or as an attribute value inside an HTML tag, and appends it to the specified output stream.
Namespace: Microsoft.SharePoint.Client.Utilities
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
Public Shared Sub HtmlEncode ( _
valueToEncode As String, _
output As TextWriter _
)
'Usage
Dim valueToEncode As String
Dim output As TextWriterHttpUtility.HtmlEncode(valueToEncode, output)
public static void HtmlEncode(
string valueToEncode,
TextWriter output
)
Parameters
valueToEncode
Type: System.StringA String representation of the data to encode.
output
Type: System.IO.TextWriterA TextWriter object that represents the output stream to which to add the encoded string.
Remarks
The HtmlEncode(String) method replaces the ampersand (&), double-quotation (“”), single-quotation (‘’), less-than (≤), and greater-than (≥) characters with the appropriate characters.
This method does not enclose the resulting string in quotation marks.