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

2 comments:

Jeff Kunzelman said...

That's some visionary stuff right there.

web lol said...

kul post