Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys,
I've written a class which inhertis from ApplicationBase and hooks up to the Document.AfterSave event.
Document.AfterSave += new Document.SaveEventHandler(Document_AfterSave);
Inside the event handler, I'm modifying some properties and I'd like to show these new values rather than the old ones. i.e.
void Document_AfterSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e) { sender.getProperty("latitude").Value = lat; sender.getProperty("longitude").Value = lon; sender.Save(); if (sender.Published) { sender.Publish(new User(0)); umbraco.library.UpdateDocumentCache(sender.Id); }}
At the moment, I have to click on the node in the tree again, navigate to the tab I was on to see the newly set values. Is there a way to do this programatically, i.e. refresh the content editor and navigate to the tab I was on?
I am having the same problem. Did you find any solution?
Btw I don't think you need to check if published explicitly, I think publish is called after save
Hi @Hardi, no I haven't unfortunately.
The reason I'm checking for (sender.Published) is because I only want to Publish if the node was initially published. If that makes sense :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Modifying properties in Document_AfterSave and showing the new values
Hi guys,
I've written a class which inhertis from ApplicationBase and hooks up to the Document.AfterSave event.
Inside the event handler, I'm modifying some properties and I'd like to show these new values rather than the old ones. i.e.
At the moment, I have to click on the node in the tree again, navigate to the tab I was on to see the newly set values. Is there a way to do this programatically, i.e. refresh the content editor and navigate to the tab I was on?
I am having the same problem. Did you find any solution?
Btw I don't think you need to check if published explicitly, I think publish is called after save
Hi @Hardi, no I haven't unfortunately.
The reason I'm checking for (sender.Published) is because I only want to Publish if the node was initially published. If that makes sense :)
is working on a reply...