Friday, August 30, 2013

Retrieve all SharePoint list in SharePoint 2013 client object model

Here we will retrieve all SharePoint list's using SharePoint 2013 client object model. Also check:

- Update website properties in SharePoint 2013 client object model

- New Feature in SharePoint 2013:Spelling Correction

- Create workflow using SharePoint designer 2013 in SharePoint 2013

Below is the full code:

ClientContext context = new ClientContext("http://SiteURL");

Web web = context.Web;

context.Load(web.Lists, lists => lists.Include(list => list.Title));

context.ExecuteQuery();

foreach (List list in web.Lists)
{
    lblSites.Text = lblSites.Text + ",  " + list.Title;
}

This will return all the SharePoint lists.


Twitter Delicious Facebook Digg Favorites More