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. Commented 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 Commented 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. Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.