Trying to show speechBubble from MediaService.Saving event
Hi,
In the saving event for the media I'm cancelling the save if they're authorised or not, and this works fine. When I get to making a speech bubble, then I hit a problem.
Not really. I did do a bit of a major hack and modified the rest message response for the particular message we were looking at. This was just a bit of luck because this message had some flags in it that I could hook in the back end, not a general solution though.
Similiar issue here, I'm trying to build in a check to the "trashing" event for content and media and I'd really like to send a speech bubble back and cancel the reload / refresh of the content tree.
Trying to show speechBubble from MediaService.Saving event
Hi,
In the saving event for the media I'm cancelling the save if they're authorised or not, and this works fine. When I get to making a speech bubble, then I hit a problem.
The line of code is:
((BasePage)HttpContext.Current.Handler).speechBubble(BasePage.speechBubbleIcon.error, "title", "error");
The error is:
Unable to cast object of type 'System.Web.Http.WebHost.HttpControllerHandler' to type 'umbraco.BasePages.BasePage'.
I've tried CurrentHandler as well.
Tried this too
ClientTools clientTool = new ClientTools((Page)HttpContext.Current.CurrentHandler);
clientTool.ShowSpeechBubble(SpeechBubbleIcon.Success, "Title", "Message");
and get the error Unable to cast object of type 'System.Web.Http.WebHost.HttpControllerHandler' to type 'System.Web.UI.Page'.
It seems the Current HttpContext isn't a Page but something else - any suggestions on how to do this?
tia,
Dave
Hi Dave,
I have the same problem. Did you manage to find a solution?
Thanks
Mitch
Hi Mitch,
Not really. I did do a bit of a major hack and modified the rest message response for the particular message we were looking at. This was just a bit of luck because this message had some flags in it that I could hook in the back end, not a general solution though.
Dave
Same problem here, but in ContentService.Saved event.
I am also facing same problem as John Hildebrant.
Similiar issue here, I'm trying to build in a check to the "trashing" event for content and media and I'd really like to send a speech bubble back and cancel the reload / refresh of the content tree.
is working on a reply...