HttpUtility.UrlKeyValueEncode Method (String, String)

Encodes a string key and value for use in a URL query string.

Namespace:  Microsoft.SharePoint.Client.Utilities
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Shared Function UrlKeyValueEncode ( _
    keyToEncode As String, _
    valueToEncode As String _
) As String
'Usage
Dim keyToEncode As String
Dim valueToEncode As String
Dim returnValue As String

returnValue = HttpUtility.UrlKeyValueEncode(keyToEncode, _
    valueToEncode)
public static string UrlKeyValueEncode(
    string keyToEncode,
    string valueToEncode
)

Parameters

Return Value

Type: System.String
The encoded string.

Remarks

Use the UrlKeyValueEncode(Guid) method to encode a URL that you are constructing instead of passing an existing URL, for example, a URL that was entered by the user.

To encode the specified string for use as an attribute value for URL type attributes, use the HtmlUrlAttributeEncode() method.

To encode an HTML string, use the HtmlEncode(String) method.

See Also

Reference

HttpUtility Class

HttpUtility Members

UrlKeyValueEncode Overload

Microsoft.SharePoint.Client.Utilities Namespace