Custom Button Error

  •  07-17-2009, 7:28 AM

    Custom Button Error

    Hi,
     
    Im getting "Command 'OnCommand' is not supported or not implemented" with the following code. Any ideas plz?
     
    1. editor.CustomAddons = "<img title=""Using oncommand"" class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" ondragstart=""CuteEditor_CancelEvent()"" Command=""OnCommand"" src=""../htmlEditor/CuteEditor_Files/Images/add-image-icon.gif"" />"&_   
    2.                       "<img title=""Using oncommand"" class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" ondragstart=""CuteEditor_CancelEvent()"" Command=""OnCommand"" src=""../htmlEditor/CuteEditor_Files/Images/link.gif"" />"  
    3.                
    4. editor.Width = 600   
    5. editor.Height = 240   
    6.   
    7. If request("postback") <> "true" then   
    8.   
    9.     editor.LoadHTML(myFile)   
    10.        
    11.     %>  
    1. <script language="JavaScript" type="text/javascript" >   
    2.     var editor1=document.getElementById("<%= editor.ClientID %>");   
    3.                  
    4.     function CuteEditor_OnCommand(editor,command,ui,value)   
    5.     {   
    6.         alert('hello');   
    7.         //handle the command by yourself   
    8.         if(command=="MyInsertLink")   
    9.         {   
    10.             //editor.ExecCommand("InsertTable");   
    11.             editor1.PasteHTML("Hello World");   
    12.             return true;   
    13.         }   
    14.     }   
    15. lt;/script>  
View Complete Thread