1

I need code for adding a folder with Client Side Object Model using Custom Content Type (Folder) on SharePoint Library.

1 Answer 1

0

This script will add folder to any library:

   var list = ctx.Web.Lists.GetByTitle(listName);
            var folder = list.RootFolder;
            ctx.Load(folder);
            ctx.ExecuteQuery();
            folder = folder.Folders.Add(folderName);
            ctx.ExecuteQuery();
3
  • 1
    It will add Folder, not custom content type of type folder.
    – Jussi Palo
    Jan 21, 2016 at 9:57
  • 1: That was quick; 2: Ok he want to add content type to the folder, I'll update my answer
    – Taran Goel
    Jan 21, 2016 at 9:58
  • 1
    No, I understand he wants to add custom content type that inherits from Folder content type - but it may be the same as adding just a normal CT.
    – Jussi Palo
    Jan 21, 2016 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.