Is it possible to get a list by url? Something like this.
Dim list As SP.List = ctx.Web.Lists.GetByURL("site")
If that isn't possible, is it possible to get the guId by using the page id?
The below solution demonstrates how to retrieve List by its Url, it consists of two steps:
Web.GetFolderByServerRelativeUrl by
specifying List UrlList id from Folder vti_listname propertyCode:
'1 step. Get List Folder
Dim listUrl As String = "/kb/Pages/"
Dim listFolder As Folder = ctx.Web.GetFolderByServerRelativeUrl(listUrl)
ctx.Load(listFolder.Properties)
ctx.ExecuteQuery()
Dim listId As Guid = New Guid(listFolder.Properties("vti_listname").ToString())
'2 step. Get List
Dim list As List = ctx.Web.Lists.GetById(listId)
ctx.Load(list)
ctx.ExecuteQuery()
Note: SharePoint 2013/Online is supported only
The following example demonstrates how to retrieve List by Page Url:
Dim pageFile = ctx.Web.GetFileByServerRelativeUrl("/kb/Pages/Welcome.aspx")
Dim pageItem = pageFile.ListItemAllFields
Dim list = pageItem.ParentList
ctx.Load(list)
ctx.ExecuteQuery()