Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetServerRelativeUrlFromPrefixedUrl method
Collapse the table of content
Expand the table of content

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)

public static string GetServerRelativeUrlFromPrefixedUrl(
	string prefixedUrl
)

Parameters

prefixedUrl
Type: System.String

The prefixed URL.

Return value

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

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

Show:
© 2015 Microsoft