Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

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


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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.