Web.ServerRelativeUrl property

Gets or sets the server-relative URL for the Web site.

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

public string ServerRelativeUrl { get; set; }

Property value

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

ExceptionCondition
ArgumentException

The site is a top-level site. Error code: - 2147024809.

It must not be a null reference (Nothing in Visual Basic). It must not contain any of the reserved URLs. It must not contain the following illegal characters: [!#$&'+:<>?\\{|}~]|(//)|(\.\.)|(/_)|(/wpresources$)|(/wpresources/).

Show: