SPWeb.GetObject Method

Retrieves a file, folder, or list item that is associated with the specified URL.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function GetObject ( _
    strUrl As String _
) As Object
'Usage
Dim instance As SPWeb
Dim strUrl As String
Dim returnValue As Object

returnValue = instance.GetObject(strUrl)
public Object GetObject(
    string strUrl
)

Parameters

Return Value

Type: System.Object
The file, folder, or list item that is associated with the specified URL.

Exceptions

Exception Condition
ArgumentNullException

strUrl is null .

Remarks

If the strUrl parameter is an empty string, this method returns the root folder of the website.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace