Copied to clipboard

Flag this post as spam?

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


  • Andreas Älveborn 31 posts 52 karma points
    Feb 25, 2011 @ 10:19
    Andreas Älveborn
    0

    UnPublish from usercontrol

    Hi all,

    I'm having this problem when I want to unpublish an node from a usercontrol. It does work and the node gets unpublish but the cache is not refreshed so the user can still see the node.
    If I unpublish the document from the cms, then I works like it's suppose to and the user wont see it.

    Here is some code:

    Document doc = new Document(id);
    doc.UnPublish();
    umbraco.library.UpdateDocumentCache(doc.Id);

  • Bogdan 250 posts 427 karma points
    Feb 25, 2011 @ 10:41
    Bogdan
    0

    Have you also tried umbraco.library.UnPublishSingleNode(id) ?

  • Andreas Älveborn 31 posts 52 karma points
    Feb 25, 2011 @ 11:15
    Andreas Älveborn
    0

    Worked like a charm. Thank you!

Please Sign in or register to post replies

Write your reply to:

Draft