次の方法で共有


SPUtility.ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls method (String, Boolean)

Converts the specified relative URL with an embedded prefix to a server-relative URL and optionally encodes the site prefix.

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

Syntax

'Declaration
Public Shared Function ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls ( _
    value As String, _
    ecmaScriptStringLiteralEncode As Boolean _
) As String
'Usage
Dim value As String
Dim ecmaScriptStringLiteralEncode As Boolean
Dim returnValue As String

returnValue = SPUtility.ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(value, _
    ecmaScriptStringLiteralEncode)
public static string ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(
    string value,
    bool ecmaScriptStringLiteralEncode
)

Parameters

  • ecmaScriptStringLiteralEncode
    Type: System.Boolean

    true to encode the site prefix; otherwise, false.

Return value

Type: System.String
Returns a String representation of the server-relative URL.

Remarks

This method converts a URL with the prefix "~site/" or "~sitecollection/" to a server-relative URL.

See also

Reference

SPUtility class

SPUtility members

ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls overload

Microsoft.SharePoint.Utilities namespace