Required some help. I am moving an item using the 'contentService' from one place to another. The item does move to the destination node, however it is still shown in the source node. I need to manually reload the browser for the item from source node to disappear. Is there any way to reload a node?
Here is my code:
private void ContentService_Saved(IContentService sender, SaveEventArgs<IContent> e)
{
foreach (var content in e.SavedEntities)
{
if (content.IsNewEntity())
{
CreatePageItemsFolder(content, sender);
}
if (content.ContentType.Alias.Equals(CasePage.ModelTypeAlias))
{
if (content.HasProperty("done") && content.GetValue<bool>("done"))
{
var contentService = ApplicationContext.Current.Services.ContentService;
var target = content.Parent().Parent().Children().Where(x => x.ContentType.Alias == CaseListingPage.ModelTypeAlias && x.Template.Alias == "DoneCasesPage").First();
if (content.ParentId!= target.Id)
{
contentService.Move(content, target.Id);
}
}
}
}
}
Reload node programmatically after content move
Hi Everybody
Required some help. I am moving an item using the 'contentService' from one place to another. The item does move to the destination node, however it is still shown in the source node. I need to manually reload the browser for the item from source node to disappear. Is there any way to reload a node? Here is my code:
is working on a reply...