Re: How can I customize Insert Image Icon in Cute Editor of Asp.Net

  •  12-10-2013, 9:27 AM

    Re: How can I customize Insert Image Icon in Cute Editor of Asp.Net

    Hi,

     

    Below is the full example.

     

    The "CuteEditor_OnCommand" API will catch the InsertImage command and execute custom command "ShowMyDialog".

     

    In "ShowMyDialog" function, the code will open your own page as a dialog for editor. "MyGallery.aspx" should change to your DotNetGallery page location. 

     

    1. <%@ Page Language="C#" %>    
    2.     
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>    
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
    5. <html xmlns="http://www.w3.org/1999/xhtml">    
    6. <head id="Head1" runat="server">    
    7.     <title>example</title>    
    8. </head>    
    9. <body>    
    10.     <form id="form1" runat="server">    
    11.         <CE:Editor ID="Editor1" runat="server">    
    12.         </CE:Editor>    
    13.         <script type="text/javascript">    
    14.         function CuteEditor_OnCommand(editor,command,ui,value)    
    15.          {    
    16.             //catch the InsertImage command    
    17.            if(command=="InsertImage")    
    18.            {    
    19.                 ShowMyDialog();  
    20.                 return true;    
    21.            }    
    22.          
    23.         }    
    24.             function ShowMyDialog()  
    25.             {  
    26.                 var editor1=document.getElementById("<%= Editor1.ClientID %>");  
    27.                 var newwin=editor1.ShowDialog(null,"MyGallery.aspx" ,editor1,"dialogWidth:800px;dialogHeight:840px");  
    28.             }  
    29.         </script>    
    30.     </form>    
    31. </body>    
    32. </html>    
     

    Regards,

     

    Ken 

View Complete Thread