This topic has not yet been rated - Rate this topic

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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.
Exception Condition
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.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ