Command 'hyperlink' Is Not Supported Or Not Implemented

Last post 10-30-2009, 10:27 PM by MDCragg. 2 replies.
Sort Posts: Previous Next
  •  10-29-2009, 6:56 PM 56799

    Command 'hyperlink' Is Not Supported Or Not Implemented

    I created a custom button on my toolbar.  It opens an AJAX modal popup that I use to insert a hyperlink (I didn't use the insert hyperlink that comes with CuteEditor for various reasons).  It works just fine once.  But if I click it a second time I get the following error:
     
    "Command 'hyperlink' Is Not Supported Or Not Implemented"
     
    Here is the VB code I use to register the button during the Page Load event:

    ctrl = Editor1.CreateCommandButton(
    "hyperlink", "link.gif", "Insert Link")

    ctrl.Attributes("onclick") = "LaunchInsertHyperlink(this)"

     

    Editor1.RegisterCustomButton("hyperlink", ctrl)

    Here is the Javascript that handles the hyperlink insertion:

     

    function LaunchInsertHyperlink()

    {

    document.getElementById('ctl00$ContentPlaceHolder_Outer$imb_InsertHyperlink').click();

    }

     

    function InsertHyperlink()

    {

    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

     

    var DisplayText = document.getElementById('ctl00$ContentPlaceHolder_Outer$txtInsertHyperlinkDisplayText').value;

    var DisplayURL = document.getElementById('ctl00$ContentPlaceHolder_Outer$txtInsertHyperlinkURL').value;

    var HyperLinkMarkUp = '<a href=\"' + DisplayURL + '\" target="_blank" >' + DisplayText + '</a>';

    editor1.ExecCommand('PasteHTML',false,HyperLinkMarkUp);

     

    var editortoolbar = document.getElementById('CE_ctl00_ContentPlaceHolder_Outer_Editor1_ID_CodeViewToolBar');

    editor1.CreateCommandButton("hyperlink", "link.gif", "Insert Link");

    }

    Here is the button that you click on the modal popup to invoke the BLOCKED SCRIPT
     
    <asp:Button ID="btnInsertHyperlink" Text="Insert" style="width: 115px; " runat="server" OnclientClick="InsertHyperlink(this)"  />
  •  10-29-2009, 11:46 PM 56808 in reply to 56799

    Re: Command 'hyperlink' Is Not Supported Or Not Implemented

    Hi,
     
    You can put this after editor :
     
    function CuteEditor_OnCommand(editor,command,ui,value)
    {
      //handle the command by yourself
     if(command=="hyperlink")
     {
      InsertHyperlink();
      return true;
     }
     return false;
    }
    Regards,
    Terry
     
  •  10-30-2009, 10:27 PM 56828 in reply to 56808

    Re: Command 'hyperlink' Is Not Supported Or Not Implemented

    I figured out a different way of handling this through clicking an ASP button.  I am going to pursue that concept.
     
    I do appreciate your response though.
     
    MDCragg
View as RSS news feed in XML