Get All List Templates in SharePoint using CSOM

The example in this topic show how to use CSOM to Get All List Templates in SharePoint

  • using Microsoft.SharePoint.Client;
  • using System.Linq;
  •  
  • using (ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"))
  • {
  • // This sentence will get all the temapltes, to create list, which are available for current site
  • ListTemplateCollection olistTemaplateCollection = clientContext.Web.ListTemplates;
  • clientContext.Load(olistTemaplateCollection);
  • clientContext.ExecuteQuery();
  •  
  • foreach (ListTemplate olistTemplate in olistTemaplateCollection)
  • {
  • Console.WriteLine("Template Name- " + olistTemplate.Name );
  • }
  • }

Similar examples using different APIs:

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