Copied to clipboard

Flag this post as spam?

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


  • Trevor Loader 199 posts 256 karma points
    Dec 10, 2012 @ 04:22
    Trevor Loader
    0

    Member Events in 4.8+

    Hi,

    I have upgraded an old 4.0.4.2 site to 4.9.1.  I had some Member events defined (as ApplicationBase) but these no longer appear to work.  I see that Application base has been deprieciated and ApplicationStartupHandler is now the one to use...but it's not.

    So I've created an test event class which has both a Document AfterSave and Member AfterSave event in it.

    The Document AfterSave event fires as it should but I cannot get the Member AfterSave (or BeforeSave) to fire.

    I've double checked that the profile definition in the web.config is correct (just in case that screwed it)...but still no joy.

    Any help, much appreciated.

    Here is my event code (note I've tried both forms of the event handler)

            public Events()
            {
                Document.AfterSave += Document_AfterSave;
                Member.BeforeSave += new Member.SaveEventHandler(Member_BeforeSave);
                Member.AfterSave += new Member.SaveEventHandler(Member_AfterSave);
                //Member.AfterSave += Member_AfterSave;
                //Member.BeforeSave += Member_BeforeSave;
            }
            void Member_BeforeSave(Member sender, SaveEventArgs e)
            {
                Log.Add(LogTypes.Debug, 0, "Member B4 Save"); // NOT WORKING
            }
            void Document_AfterSave(Document sender, SaveEventArgs e)
            {
                Log.Add(LogTypes.Debug, 0, "Document Save");  // THIS WORKS
            }
            void Member_AfterSave(Member sender, SaveEventArgs e)
            {
                Log.Add(LogTypes.Debug, 0, "Member After Save"); // NOT WORKING
            }
        }

     

Please Sign in or register to post replies

Write your reply to:

Draft