Copied to clipboard

Flag this post as spam?

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


  • Dave N 13 posts 34 karma points
    Jun 05, 2014 @ 07:19
    Dave N
    0

    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

     

     

  • Mitch 1 post 21 karma points
    Jul 14, 2014 @ 16:20
    Mitch
    0

    Hi Dave,

    I have the same problem. Did you manage to find a solution?

    Thanks

    Mitch

  • Dave N 13 posts 34 karma points
    Jul 17, 2014 @ 06:44
    Dave N
    0

    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

  • John Hildebrant 14 posts 35 karma points
    Jul 21, 2014 @ 20:21
    John Hildebrant
    0

    Same problem here, but in ContentService.Saved event.

  • Keyur Shah 14 posts 44 karma points
    Oct 15, 2014 @ 12:46
    Keyur Shah
    0

    I am also facing same problem as John Hildebrant.

     

     

  • Mark Drake 133 posts 457 karma points c-trib
    Dec 07, 2014 @ 21:15
    Mark Drake
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft