1

I've created doc type with property e.g. (Name = "ItemId" Type = "Label") When i try to "Save and Publish" node with current doc type i set some value to this label. (note that i override SendAsync method)

currentContent.SetValue("ItemIdAlias","guidvalue");

It sets value correctly, but label still appears to be empty. So if i click on "Save and Publish" second time it sends an empty value still... I need somehow to refresh page because on second time i need "guidvalue" to update other items

progproger
  • 958
  • 2
  • 10
  • 21
  • If you want to modify values on save or save and publish, use the `ContentService` events. You can see an example of this in this answer: http://stackoverflow.com/a/32887279/2843504 - explore the various events exposed by `ContentService`. – Robert Foster Oct 05 '15 at 13:40
  • @RobertFoster Thanks for your response. As i said i can modify values on save and publish. But i need to refresh page after, because on second time it still sends and empty value of label. Example : On first page load i press "Save and publish". It sets value to property label in DB, but it does not shown on page still. But when i refresh the page(F5) it shows me data correctly, or just navigate to other node and return back. The problem is when i stay in current page and click on save and publish two times – progproger Oct 05 '15 at 14:08

1 Answers1

0

If you're using Umbraco 6, you'll need to get your event handler to emit some JS to refresh the page. You can do this by calling the following code in your Event Handler:

BasePage.Current.ClientTools.ChangeContentFrameUrl(string.Concat("editContent.aspx?id=", docId));

Where docId is the id of the page you are editing. This will force a full reload of the page, and your label should then have a value!

If you're using Umbraco 7, you're out of luck, there's currently no way to do this from the server side. You might be able to listen to the angular save event and do something there maybe? But I'm not 100% if that's possible currently.

Tim
  • 4,217
  • 1
  • 15
  • 21