Compartilhar via


SPHttpUtility.UrlKeyValueEncode Method (Int32)

Encodes an integer key or value for use in a URL query string.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Shared Function UrlKeyValueEncode ( _
    keyOrValueToEncode As Integer _
) As String
'Usage
Dim keyOrValueToEncode As Integer
Dim returnValue As String

returnValue = SPHttpUtility.UrlKeyValueEncode(keyOrValueToEncode)
public static string UrlKeyValueEncode(
    int keyOrValueToEncode
)

Parameters

  • keyOrValueToEncode
    Type: System.Int32

    The 32-bit integer key or value to be encoded.

Return Value

Type: System.String
The encoded string.

Remarks

Use the UrlKeyValueEncode 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 property.

See Also

Reference

SPHttpUtility Class

SPHttpUtility Members

UrlKeyValueEncode Overload

Microsoft.SharePoint.Utilities Namespace