Re: paste command issue.

  •  09-23-2010, 3:58 AM

    Re: paste command issue.

    Hi gurpreet,
     
    Can you explain your issue on detail?
     
    Can you show me the steps to reproduce this issue?
     
    Please try the example below
     
    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.   
    6. <script runat="server">   
    7.   
    8.     protected override void OnLoad(EventArgs e)   
    9.     {   
    10.         Editor1.Text = "<table border='0' width='496'><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> </tr></table>"; ;   
    11.         base.OnLoad(e);   
    12.     }   
    13. </script>   
    14.   
    15. <html xmlns="http://www.w3.org/1999/xhtml">   
    16. <head runat="server">   
    17.     <title>Untitled Page</title>   
    18. </head>   
    19. <body>   
    20.     <form id="form1" runat="server">   
    21.         <div>   
    22.             <CE:Editor ID="Editor1" runat="server">   
    23.             </CE:Editor>   
    24.             <input type="button" value="Insert" onclick="insertText()" />   
    25.         </div>   
    26.     </form>   
    27. </body>   
    28. </html>   
    29.   
    30. <script>   
    31. function insertText()   
    32. {   
    33.     var editor1=document.getElementById("<%= Editor1.ClientID %>");   
    34.     var text = '<input id="first_name" value="[FirstName]" type="input" name="first_name" />';   
    35.     editor1.ExecCommand("PasteHTML"false, text);    
    36. }   
    37. </script>  
    Regards,
     
    ken
View Complete Thread