Copied to clipboard

Flag this post as spam?

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


  • David F. Hill 122 posts 242 karma points
    Dec 01, 2009 @ 22:57
    David F. Hill
    0

    Delete content node programmatically

    Hello Umbraco Colleagues,

    Can someone please tell me how to delete a content node programmatically (as in C#, user control) and remove it from the cache?

    I can't seem to find an example. (ver. 4)

    Thanks,

    David Hill

  • Peter Gregory 407 posts 1611 karma points MVP 3x admin c-trib
    Dec 01, 2009 @ 23:27
    Peter Gregory
    1

    THis should do it for you.

    This will delete it.

    Document d = new Document(id);
    d.delete();

    This will refresh the content so it disapears.

    umbraco.library.RefreshContent();

    Hope that helps

    Peter

  • David F. Hill 122 posts 242 karma points
    Dec 02, 2009 @ 00:02
    David F. Hill
    0

    Thank you, Peter. That helped a lot. Exactly what I needed!

    David

  • 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