private string GetRootSiteUrl()
{
string urlValue = "";
using (SPSite sPSite = new SPSite(site.ID))
{
using (SPWeb sPWeb = sPSite.OpenWeb(web.ID))
{
Uri url = new Uri(sPWeb.Url);
urlValue = url.GetLeftPart(UriPartial.Authority);
return urlValue;
}
}
}
{
string urlValue = "";
using (SPSite sPSite = new SPSite(site.ID))
{
using (SPWeb sPWeb = sPSite.OpenWeb(web.ID))
{
Uri url = new Uri(sPWeb.Url);
urlValue = url.GetLeftPart(UriPartial.Authority);
return urlValue;
}
}
}
No comments:
Post a Comment