Re: Select A Tag

  •  01-15-2014, 8:45 AM

    Re: Select A Tag

    Hi AndyFel,

     

    Please try the example below, it shows you how to get the link code.

     

    1. <%@ Page Language="c#" %>  
    2.   
    3. <%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>  
    4.   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    6. <html xmlns="http://www.w3.org/1999/xhtml">  
    7. <head>  
    8.     <title></title>  
    9.     <script runat="server">  
    10.         protected override void OnLoad(EventArgs e)  
    11.         {  
    12.             Editor1.Text = "<a href='http://www.google.com'>test</a>";  
    13.             base.OnLoad(e);  
    14.         }  
    15.     </script>  
    16. </head>  
    17. <body>  
    18.     <form id="Form1" method="post" runat="server">  
    19.   
    20.         <RTE:Editor runat="server" ID="Editor1"/>  
    21.         <input type="button" value="Get Link Code" onclick="getPointCode()" />  
    22.     </form>  
    23. </body>  
    24. </html>  
    25. <script type="text/javascript">  
    26.     function getPointCode()  
    27.     {  
    28.         var editor1 = document.getElementById('<%= Editor1.ClientID%>').editor;  
    29.         alert(editor1.GetPointNode().GetParent().GetHtmlCode());  
    30.     }  
    31.  </script>  
     

    Regards,

     

    Ken 

View Complete Thread