Copied to clipboard

Flag this post as spam?

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


  • Matt Speakman 11 posts 44 karma points
    Sep 29, 2015 @ 13:32
    Matt Speakman
    0

    MemberService.Saving Event

    Hello, I have a client that would like to stop their editors from being able to delete members as this would break their site. I have hooked into the MemberService.Saving event as such

            protected override void ApplicationStarted (UmbracoApplicationBase umbracoApplication,
            ApplicationContext applicationContext)
        {
            MemberService.Deleting += MemberServiceOnDeleting;
        }
    
        private void MemberServiceOnDeleting(IMemberService sender, DeleteEventArgs<IMember> e)
        {
            e.Cancel = true;
        }
    

    However most of the time when I refresh the page all I get is a white screen and a console error

    "Uncaught SyntaxError: Unexpected token <" "Application?umb__rnd=7f6480d:1".

    I have hooked into events before and I don't seem to get any problems if I comment out "e.Cancel = true;".

    Is there something else going on here or is this something that I really shouldn't be doing?

    Any help anyone can give me on this topic would be greatly appreciated.

    Thanks,

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft