次の方法で共有


SPHttpUtility.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.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function HtmlUrlAttributeEncode ( _
    urlAttributeToEncode As String _
) As String
'Usage
Dim urlAttributeToEncode As String
Dim returnValue As String

returnValue = SPHttpUtility.HtmlUrlAttributeEncode(urlAttributeToEncode)
public static string HtmlUrlAttributeEncode(
    string urlAttributeToEncode
)

Parameters

Return value

Type: System.String
The encoded string.

Remarks

The HtmlUrlAttributeEncode 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

SPHttpUtility class

SPHttpUtility members

HtmlUrlAttributeEncode overload

Microsoft.SharePoint.Utilities namespace