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.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.SPListThe 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.