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 408 posts 1614 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

Please Sign in or register to post replies

Write your reply to:

Draft