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

Get WebURL from full url

$
0
0

So let's say I have a full url into a sharepoint website.  

In the past when I wanted to get the weburl and doc url, I used the "url to web url"  method of the Front Page Server Extensions. (http://msdn.microsoft.com/en-us/library/ms460544.aspx).

So for example if you had a site at http://webapp/site1/chidsite.a.doc, I want a method in CSOM that will return /site1/childsite as the weburl.

I see the Web.WebUrlFromPageUrlDirect() method in CSOM but I'm not sure I'm getting what I need back from it. In the Uri class I get back, would I use teh "AbsolutePath" property for the weburl?

What is the correct way to do this?




Viewing all articles
Browse latest Browse all 25064

Trending Articles



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