Re: Javascript Error when call "editor.ExecCommand('InsertDocument');"

  •  01-19-2016, 8:49 AM

    Re: Javascript Error when call "editor.ExecCommand('InsertDocument');"

    Hi,

     

    Please try the example page below, does it work for you?

     

    1. <%@ Page Language="C#" ValidateRequest="false" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4. <html>  
    5. <head>  
    6.     <title>example </title>  
    7. </head>  
    8. <body>  
    9.     <form id="Form1" runat="server">  
    10.         <CE:Editor ID="Editor1" runat="server" UseStandardDialog="true">  
    11.         </CE:Editor>  
    12.         <input type="button" value="custom command" onclick="myCommand()" />  
    13.     </form>  
    14. </body>  
    15. </html>  
    16.   
    17. <script type="text/javascript">  
    18.     function myCommand()  
    19.     {  
    20.         var editor1 = document.getElementById('<%= Editor1.ClientID%>');  
    21.         editor1.ExecCommand("InsertDocument");  
    22.     }  
    23. </script>  
     

    Regards,

     

    Ken 

View Complete Thread