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)" />