Pages

Monday, January 23, 2012

SharePoint Code

// SharePoint Object Model

SPContext ctx = SPContext.Current;
SPSite site = ctx.Site;
SPWeb web = site.RootWeb;
foreach (var list in web.Lists)
    {
        writer.Write(list.Title + "
");
    }

 Guid siteId = ctx.Site.ID; //another way  of retrieving web content

 SPSite site = new SPSite(siteId);
 SPWeb web = site.RootWeb;


No comments:

Post a Comment