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);
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);
Have you also tried umbraco.library.UnPublishSingleNode(id) ?
Worked like a charm. Thank you!
is working on a reply...