SPContext.Current

// root site – eg. Web App url
string rootSiteCollectionURL = SPContext.Current.Web.Site.WebApplication.Sites[0].Url;

// site collection url
string SiteCollectionURL = SPContext.Current.Web.Site.Url;

Comments

Popular posts from this blog

How to Create an Auto-Incrementing Number Field in a SharePoint List

SharePoint Integration with IIS

Error:Installing product D:\exchangeserver.msi failed. Fatal error during installation. Error code is 1603.