Share via


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)

Syntax

'Declaration
Public Property ServerRelativeUrl As String
    Get
    Set
'Usage
Dim instance As Web
Dim value As String

value = instance.ServerRelativeUrl

instance.ServerRelativeUrl = value
public string ServerRelativeUrl { get; set; }

Property value

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

Exceptions

Exception Condition
ArgumentException

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

Remarks

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/).

See also

Reference

Web class

Web members

Microsoft.SharePoint.Client namespace