HttpUtility.HtmlUrlAttributeEncode Method (String, TextWriter)

Encodes the specified string for use as an attribute value for URL type attributes, such as the href attribute of an anchor tag or the src attribute of an image 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 HtmlUrlAttributeEncode ( _
    urlAttributeToEncode As String, _
    output As TextWriter _
)
'Usage
Dim urlAttributeToEncode As String
Dim output As TextWriterHttpUtility.HtmlUrlAttributeEncode(urlAttributeToEncode, _
    output)
public static void HtmlUrlAttributeEncode(
    string urlAttributeToEncode,
    TextWriter output
)

Parameters

Remarks

The HtmlUrlAttributeEncode(String) method checks the URL protocol and, if the URL is relative or has an allowed protocol, encodes the string for use as an attribute value. It does not encode the path or query string of the URL. If you are building a URL, call UrlPathEncode and UrlKeyValueEncode separately before you call this method.

See Also

Reference

HttpUtility Class

HttpUtility Members

HtmlUrlAttributeEncode Overload

Microsoft.SharePoint.Client.Utilities Namespace