I was playing with this in the Lvl. 2 Certification class and have an answer for the Move event which mostly works (I'll post it as a reply) but I'm interested in any refinements or better ways to do this. The publish event seemed to override this so it isn't complete, yet but the method I'll post allows you to get access to the Page object from the event.
There is no need for the Document reference. Here is a static method I have used to handle event exceptions. Just call it in a try catch and pass in the exception.
How do I do create a speech bubble from an event?
I was playing with this in the Lvl. 2 Certification class and have an answer for the Move event which mostly works (I'll post it as a reply) but I'm interested in any refinements or better ways to do this. The publish event seemed to override this so it isn't complete, yet but the method I'll post allows you to get access to the Page object from the event.
So this is what I'm currently doing for the AfterMove event, which works... mostly. Please note you do have to hook the event up.
There is no need for the Document reference. Here is a static method I have used to handle event exceptions. Just call it in a try catch and pass in the exception.
private static void ShowErrorBubble(string title, Exception exception)
{
((BasePage)HttpContext.Current.Handler).speechBubble(BasePage.speechBubbleIcon.error, title, exception.Message);
}
Here's prettier code:
One more time:
is working on a reply...