Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James 8 posts 37 karma points
    May 15, 2014 @ 15:06
    James
    0

    Can't cancel saving of content from Content API

    I'm trying to cancel the saving of content using the Content Services in Umbraco 6.20.

    I have the following code.

    void ContentService_Saving(Umbraco.Core.Services.IContentService sender, Umbraco.Core.Events.SaveEventArgs<IContent> e)

            {

                e.Cancel = true;

            }

     

    I'm just trying to prevent the saving of all content as a test however when I click the save button in the back office I am still presented with a success message.

    If I breakpoint I can see that the value of e.CanCancel is true so I was expecting to be able to cancel the saving process.

    Is anyone able to point out the mistake I am making in this?

Please Sign in or register to post replies

Write your reply to:

Draft