共用方式為


Site.OpenWeb Method

Opens a new site using the specified URL.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Function OpenWeb ( _
    strUrl As String _
) As Web
'Usage
Dim instance As Site
Dim strUrl As String
Dim returnValue As Web

returnValue = instance.OpenWeb(strUrl)
[RemoteAttribute]
public Web OpenWeb(
    string strUrl
)

Parameters

  • strUrl
    Type: System.String

    Specifies the server-relative URL or web-relative URL of the site to open. If strurl is empty, the top-level site must be opened.

Return Value

Type: Microsoft.SharePoint.Client.Web
Returns a Web instance representing the opening of a new site using the specified URL.

Exceptions

Exception Condition
[System.ArgumentException]

The specified URL must refer to a valid site. Error code: -2147024809.

Remarks

It must not be a null reference (Nothing in Visual Basic).

See Also

Reference

Site Class

Site Members

Microsoft.SharePoint.Client Namespace