Copied to clipboard

Flag this post as spam?

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


  • progproger 52 posts 130 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 2155 posts 14408 karma points MVP 9x 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

Please Sign in or register to post replies

Write your reply to:

Draft