Copied to clipboard

Flag this post as spam?

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


  • anusha 6 posts 26 karma points
    Feb 07, 2013 @ 14:06
    anusha
    0

    Delete node programmatically

    How to delete umbraco node programmatically?.. not parent node

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Feb 07, 2013 @ 15:23
    Bo Damgaard Mortensen
    0

    Hi anusha,

    You'll have to grab a reference to the Document (depending on which version of Umbraco you run) like this:

    var doc = new Document(documentId);
    doc.Delete(true); // pass true in to deleted it permanently
    umbraco.library.RefreshContent(); // update cache 

    Hope this helps :-)

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft