Create List in SharePoint using CSOM

The example in this topic show how to use CSOM to Create List in SharePoint

  • using Microsoft.SharePoint.Client;
  •  
  • using (ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"))
  • {
  • // The properties of the new custom list
  • ListCreationInformation creationInfo = new ListCreationInformation();
  • creationInfo.Title = "ListTitle";
  • creationInfo.Description = "New list description";
  • creationInfo.TemplateType = (int)ListTemplateType.GenericList;
  •  
  • List newList = clientContext.Web.Lists.Add(creationInfo);
  • clientContext.Load(newList);
  • // Execute the query to the server.
  • clientContext.ExecuteQuery();
  • }

Thank you for reading this article. This code was tested in SharePoint 2013

We value your feedback:

Page URL:

Name:

 

Email:

 
 

Feedback:

 

© 2019 Code SharePoint