/*-----find the root website to -----------*/
SPWeb rootweb= null;
foreach (SPWeb spweb in SPContext.Current.Site.AllWebs) //this returns all sites in the site
// collection
{
if (spweb.IsRootWeb)
{
rootweb = spweb;
break;
}
}
What's wrong with SPContext.Current.Site.RootWeb ?
ReplyDelete