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