Try our conversational search powered by Generative AI!

Invoke client side script after ContenMove event was cancelled



We need to invoke clientside script after we cancel MovingContnet event.

var contentEventRaiser = ServiceLocator.Current.GetInstance();
contentEventRaiser.MovingContent += OnMovingContent;
private static void OnMovingContent(object sender, ContentEventArgs args)
    if (...)
        args.CancelAction = true;
        args.CancelReason = "....";

Async request is made to ContentStructure store service.

Any hints were e would need to hook in would be greatly appreciated.


Jun 28, 2015 10:52


Aug 03, 2015 14:34

Hi Validis

Since it's client side I would personally look to hook into the exception message with Dojo in the EPiServer UI and work from there. I don't know if any topics are published in Dojo if/when an exception is raised or even better if they contained some exception information such as moved cancelled. I will see if I can take a look...

What is your specific requirement?


Aug 04, 2015 12:05

I do some content manipulation on the server side within this event context. From EPiServer UI it seems like action has been cancelled, but it's not. Let's say scenario - I move the content, cancel original page movement, but update other content. By cancelling the original movement event, EPiServer is showing this dialog window, that event has been cancelled. Page tree stays the same. So basically - I would need to refresh UI to reflect new changes.

Maybe I need to implement my requirement differently from the very beginning and avoid event cancellation at all?!

Aug 04, 2015 12:16

Your scenario makes sense, if you wanted to hook into this client side then you can take a look at: \modules\_protected\CMS\\<Version>\ClientResources\epi-cms\widget\ContentTreeModelConfirmation.js.uncompressed.js.

Thats the guy that actually does the work of showing the message after a move/paste so you could trigger a refresh when the dialog has been shown.

From now on it depends on how much Dojo you know :)?


Aug 04, 2015 12:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.