HttpUtility.HtmlUrlAttributeEncode Method (String)
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.
Namespace: Microsoft.SharePoint.Client.Utilities
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
Public Shared Function HtmlUrlAttributeEncode ( _
urlAttributeToEncode As String _
) As String
'Usage
Dim urlAttributeToEncode As String
Dim returnValue As String
returnValue = HttpUtility.HtmlUrlAttributeEncode(urlAttributeToEncode)
public static string HtmlUrlAttributeEncode(
string urlAttributeToEncode
)
Parameters
urlAttributeToEncode
Type: System.StringA String representation of the data to encode.
Return Value
Type: System.String
A String representation of the encoded value.
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 the query string of the URL. If you are building a URL, call UrlPathEncode() and UrlKeyValueEncode separately before you call this method.