Wednesday, January 14, 2009

Site Collection Owner Webpart Code

public class OwnerPart : WebPart
{
protected override void CreateChildControls()
{
SPSite site = Microsoft.SharePoint.WebControls.SPControl.GetContextSite(HttpContext.Current);
string owner = site.Owner.Name;
Controls.Add(new LiteralControl("Owner: " + owner));
}
}

-Brian Grabowski