Word count - is there a way to get this property value?

Last post 06-17-2010, 9:57 AM by Eric. 1 replies.
Sort Posts: Previous Next
  •  06-17-2010, 4:15 AM 61841

    Word count - is there a way to get this property value?

    i need to get the exact word count shown by the editor.
    how can i get it?
  •  06-17-2010, 9:57 AM 61848 in reply to 61841

    Re: Word count - is there a way to get this property value?

    1. Specifies whether the Word Count toolbar appear.
     
    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
      <title>ASP and ASP.NET WYSIWYG Editor - Edit Static Html Example </title> 
     </head>
     <body>
            <form id="Form1" runat="server">   
            <CE:Editor id="Editor1" runat="server" ShowWordCount="True"></CE:Editor><BR>
            <asp:Button id="btnUpdate" onclick="Submit" Runat="server" Text="Submit"></asp:Button><br />   
         <asp:textbox id="textbox1" runat="server" TextMode="MultiLine" Height="250px" Width="750px" Font-Name="Arial"></asp:TextBox> 
      </form>
     </body>
    </html>
    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
      {
        
      }
     public void Submit(object sender, System.EventArgs e)
     {   
       textbox1.Text = Editor1.PlainText; 
     }
    </script>
     
     
    2. If you want to get word count by yourself, please retrieve the content of CuteEditor as HTML then count it youself.
     
    getHTML()

    This method is used for retrieving the content of CuteEditor as HTML.

    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

    // retrieving the content of Cute Editor as HTML
    var content = editor1.getHTML();
    alert(content );
     
     
     
    Regards,
    Eric
     
     
View as RSS news feed in XML