Expand Minimize
0 out of 1 rated this helpful - 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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.