Some SharePoint objects expose relative paths.
Relative paths can be converted to full Url by adding
current server, site paths.
To convert a relative path to the full URL, you add the
current server,
Rather than performing path manipulation,
"GetFullUrl" method can be used.
Example- Get Full Url Of A SharePoint List
SPUtility.GetFullUrl(SPContext.Current.Site, listobj.DefaultDisplayFormUrl);
Example- Get Full Url Of A SharePoint ListItem
SPUtility.GetFullUrl(SPContext.Current.Site,"/"+
itemobj.Url);
No comments:
Post a Comment