次の方法で共有


SPUtility.GetServerRelativeUrlFromPrefixedUrl method

Converts a URL prefixed with "~site/" or "~sitecollection/" into a server-relative URL.

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

Syntax

'Declaration
Public Shared Function GetServerRelativeUrlFromPrefixedUrl ( _
    prefixedUrl As String _
) As String
'Usage
Dim prefixedUrl As String
Dim returnValue As String

returnValue = SPUtility.GetServerRelativeUrlFromPrefixedUrl(prefixedUrl)
public static string GetServerRelativeUrlFromPrefixedUrl(
    string prefixedUrl
)

Parameters

Return value

Type: System.String
A string containing the server-relative URL

Remarks

If the prefixedUrl parameter does not start with "~site/" or "~sitecollection/" then it will be returned without modification.

See also

Reference

SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace