I know the URL to a document Library folder and I am able to successfully retrieve that folder using Client Object Model GetFolder. However, I do not know the Document Library title, how can I get the metadata of the Document Library that the folder I am on is in? I can C# or vb.net.
1 Answer
I am assuming that your code to GetFolder would be something like below, if yes then the code to get Document library title would be as follows:
string url = web.ServerRelativeUrl + "/shared documents/test folder";
SPFolder folder = web.GetFolder(url);
var docLibTitle = folder.Item.ParentList.Title;
-
Thank you; however, the code provided is for SharePoint Object Model. I am using the Client Object Model it uses: sp.Folder Folder = web.GetFolderByServerRelativeUrl(url library name); after getting the folder Item is not available nor ParentList.– pardarkCommented Nov 22, 2016 at 21:45