Cute Editor for ASP

Add your own custom buttons

Add your own custom buttons

You can easily add your own custom buttons to the CuteEditor toolbar using the following method:

Add your own custom buttons into the custom button holder:

 

  1. <%     
  2.    Dim editor   
  3.    Set editor = New CuteEditor   
  4.      
  5.    editor.ID = "Editor1"  
  6.    editor.Text = "Type Here"  
  7.    editor.TemplateItemList="G_start,Bold,Italic,Holder,G_end"  
  8.    editor.CustomAddons = "<img class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" Command=""MyCmd"" src=""contact.gif"" />"  
  9.       
  10.    editor.Draw()   
  11.      
  12.    ' Request.Form(ID) access from other page   
  13.     
  14.  %>   
  15.        
  16.     <script language="JavaScript" type="text/javascript" >   
  17.         vareditor1=document.getElementById("<%= editor.ClientID %>");   
  18.                      
  19.         function CuteEditor_OnCommand(editor,command,ui,value)   
  20.         {   
  21.             //handle the command by yourself   
  22.             if(command=="MyCmd")   
  23.             {   
  24.                 //editor.ExecCommand("InsertTable");   
  25.                 editor1.PasteHTML("Hello World");   
  26.                 return true;   
  27.             }   
  28.         }   
  29.   
  30.   
  31.    </script>