Copied to clipboard

Flag this post as spam?

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


  • progproger 49 posts 127 karma points
    Sep 28, 2015 @ 11:12
    progproger
    0

    Pop up an error in ApplicationStarted event

    Hi,

    I'd like to call pop up window and set custom error in admin page.

    I use the following code:

    protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

        {
            ContentService.Published += ContentServicePublished;
        }
    

    private void ContentServicePublished(IPublishingStrategy sender, PublishEventArgs

    throw new Exception("custom message");

    }

  • Marc Goodson 1451 posts 9716 karma points MVP 5x c-trib
    Oct 03, 2015 @ 22:07
    Marc Goodson
    1

    If you are using Umbraco 7.3.0, this has been added so you can add messages to trigger a notification event:

    http://issues.umbraco.org/issue/U4-5927

    (scroll down a bit) and you will see:

     e.Messages.Add(new EventMessage("Mwahahahaha!", "I've cancelled all of your saving!", EventMessageType.Error));
    

    is that the kind of thing you are after ?

    regards

    Marc

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies