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 712 posts 1189 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

  • 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