Regarding PasteHTML method.

Last post 07-14-2009, 6:12 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  07-14-2009, 2:54 AM 53949

    Regarding PasteHTML method.

    Hi Ken/Adam,
     
    The method PasteHTML is inserting data at the starting position when cursor in not in the editor. Do we have any way to insert the data at the end of HTML editor for the same scenerio?
     
     
     
  •  07-14-2009, 6:12 AM 53951 in reply to 53949

    Re: Regarding PasteHTML method.

    Hi sanjay.joshi,
     
    Try this way
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Namespace="CuteEditor" Assembly="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>Untitled Page</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <div>   
    12.             <CE:Editor ID="editor1" runat="server">   
    13.             </CE:Editor>   
    14.             <input type="button" value="PasteHTML" onclick="insert()" />   
    15.         </div>   
    16.     </form>   
    17. </body>   
    18. </html>   
    19.   
    20. <script type="text/javascript">   
    21. function insert()   
    22. {   
    23. var editor1=document.getElementById('<%= editor1.ClientID%>');   
    24. var content = editor1.getHTML();   
    25. editor1.setHTML(" ");   
    26. editor1.PasteHTML(content+"Hello World");   
    27. }   
    28. </script>  
    Regards,
     
    ken
View as RSS news feed in XML