Tuesday, October 28, 2014

Working with SharePoint folder properties using CSOM (Client Side Object model ) in SharePoint 2013

 

Accessing folder properties are but different from  SharePoint list item access. Following code demonstrates  the basics.

Create SharePoint Folder with Properties

using (var clientContext = ypurMethodToGetSpContectt() )
{
 
    var lst = clientContext.Web.Lists.GetByTitle("ListName");
    var folder = lst.RootFolder.Folders.Add("FolderName");
    
    folder.Properties["property1"] = "sample";
    folder.Properties["property1"] = "sample";
 
    folder.Update();
    clientContext.ExecuteQuery();
 
}
Post a Comment