Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetListFromUrl Method

SPWeb.GetListFromUrl Method

Windows SharePoint Services 3

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

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

public SPList GetListFromUrl(
	string pageUrl
)

Parameters

pageUrl
Type: System.String
A string that contains the site-relative URL of a Web Part page, for example, Lists/Announcements/AllItems.aspx.

Return Value

Type: Microsoft.SharePoint.SPList
An SPList object that represents the list.

The GetListFromUrl method does not return the list that is associated with the specified Web Part page. To return the list that is associated with a specified URL, use the GetList method.

Community Additions

ADD
Show:
© 2015 Microsoft