Forum Discussion
Xiaoyuan Zhang
Jul 14, 2017Former Employee
What's the relationship between list url and site url
I need make CSOM call, when I new a context, I need the site url. But I only have list document url, such as
https://XXX.sharepoint.com/teams/AAA/Shared Documents/
Should I remove last "Shar...
sunny rajpal
Jul 17, 2017Copper Contributor
SharePoint list/library url is basically adding the library name to the site url and in your case it is like
Site URL https://XXX.sharepoint.com/teams/AAA/
Document Library URL is https://XXX.sharepoint.com/teams/AAA/ + Shared Documents i.e. https://XXX.sharepoint.com/teams/AAA/Shared Documents/
So to get the site url just remove the Shared documents
- Jul 17, 2017
Can you give some more details on what you are trying to do.
If you are for example using CSOM you could get a list object using the list url and then via list.ParentWeb get the url of the site
- Xiaoyuan ZhangJul 17, 2017Former EmployeeHow can I use CSOM when I don't know site url ?