paste command issue.

Last post 09-23-2010, 3:58 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  09-21-2010, 1:44 PM 64124

    paste command issue.


    paste command is not pasting the required html where the cursor position is.
     
    for our testing we have following html -
     
    <table border="0" width="496"><tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr></table>
     
    we are trying to paste using the code below -
    var text = "<input id="first_name" value="[FirstName]" type="input" name="first_name" />"
    ExecCommand("PasteHTML", false, text);
     
    but the above code works fine, when we have the following html -
     
    <table border="0" width="496"><tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr></table>
     
    the difference you can see is of the spaces.
     
  •  09-23-2010, 3:58 AM 64155 in reply to 64124

    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 as RSS news feed in XML