1

How to get ServerRelativeUrl from Full Url in CSOM code. In server side code SPWeb.GetServerRelativeUrlFromUrl() method which accepts a full, server-relative or site-relative URL as a parameter and returns the server-relative URL.

4

Following code will return the ServerRelativeUrl:

Uri uri = new Uri(fullURL);
string serverRelativeURL = uri.AbsolutePath;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.