Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arun 9 posts 29 karma points
    Nov 04, 2011 @ 10:10
    Arun
    0

    Adding Children for a Document

    Hi

       I want to manipulate a Document in runtime and need to add some children to the same. Is there any API exist to add children at run time to a Document

     

    Regards

    Arun

     

     

  • Owen 123 posts 246 karma points
    Nov 04, 2011 @ 13:35
    Owen
    1

    Sure, there is an class name as "Document" in the API, and it has a static method "MakeNew, you can use this method.

    When you try to create a new document, you need to pass in parent id for new document.

    Here is some sample code:

    var partentDocumentID = 1000;

    var child = Document.MakeNew("Name", DocumentType, User, partentDocumentID);

    child.Save()

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Nov 04, 2011 @ 14:00
    Tom Fulton
    0

    +1.  Check out this wiki for more info:  http://our.umbraco.org/wiki/reference/api-cheatsheet/creating-a-document

    -Tom

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies