GetListFromUrl method
TOC
Collapse the table of content
Expand the table of content

SPWeb.GetListFromUrl method

Gets the list that is associated with the first Web Part on the specified Web Parts page. Beginning in Windows SharePoint Services 3.0, use the GetListFromWebPartPageUrl method instead of this method.

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

public SPList GetListFromUrl(
	string pageUrl
)

Parameters

pageUrl
Type: System.String

The server-relative URL of a Web Parts page, such as /sites/sitecollection/subsite/default.aspx.

Return value

Type: Microsoft.SharePoint.SPList
The list that is associated with the first Web Part on the specified page.

ExceptionCondition
ArgumentNullException

The pageUrl parameter is null reference.

SPException

Either the URL is invalid, or the first Web Part on the specified Web Parts page is not associated with lists.

This method returns the list that is associated with the first Web Part on the specified Web Parts page. To return the list that is associated with the Web Parts page itself, use the GetList method.

Show:
© 2016 Microsoft