Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Get ClientContext from Full sharepoint url?

$
0
0

I am receiving a full sharepoint url like 'http://TestServer/sites/TestSite/TestSubSite/_vti_bin/lists.asmx'

I know the following code will not work as the url does not directly reference a site.

using (var context = new ClientContext(http://TestServer/sites/TestSite/TestSubSite/_vti_bin/lists.asmx))

{
}

My question is...considering urls are provided to me, what logic can I apply to modify the url so that I am only referencing the subsite 'http://TestServer/sites/TestSite/TestSubSite'?

Thanks heaps.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>