Implementing Spelling Check Feature using TinyMCE Rich Text Editor in ASP.Net
 
Author:
Filed Under: ASP.Net  |  Rich Text Editor
Published Date: Jul 11, 2010
Views: 4416
 

Abstract: Here Mudassar Ahmed Khan has explained how to implement Spell check feature in TinyMCE Rich Text Editor using TinyMCE SpellCheck Plugin in ASP.Net

Comments:  1

 

In this article I am explaining how to add Spelling Check Feature in TinyMCE Rich Text Editor. To get more information on how to implement TinyMCE Rich Text Editor in ASP.Net refer my article
Once TinyMCE is implemented in your ASP.Net project, you will need to download the TinyMCE .Net Package that contains the Spell Checker plugin from the TinyMCE website using the following link
Direct Link to the package is given below
 
Once downloaded unzip the package. Now in your ASP.Net project, right click the project and click Add Reference. Now navigate to the folder where you unzipped the TinyMCE .Net Package and search for the Moxiecode.TinyMCE.dll in the folder and add its reference as shown in the image below.
TinyMCE SpellCheckFeature plugin in ASP.Net
Once you do that you will see that the following key has been added to your Web.Config file.
<httpHandlers>
      <addverb="GET,HEAD,POST"path="TinyMCE.ashx"type="Moxiecode.TinyMCE.Web.HttpHandler,Moxiecode.TinyMCE" />
</httpHandlers>

Above you will notice path="TinyMCE.ashx" This value we will need to use in the TinyMCE configuration script
Note: If it does not add directly you can copy and paste the above key in your Web.Config in the <system.web> section.
Next you need to configure your TinyMCE for the spellcheck feature. Below is the TinyMCE configuration script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>TinyMCE ASP.Net Example</title>
 
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
   tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        plugins : "spellchecker",
        theme_advanced_buttons4 : "spellchecker",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false,
        spellchecker_languages: "English=en",
        spellchecker_rpc_url: '<%=ResolveUrl("~/TinyMCE.ashx?module=SpellChecker") %>'
    });
</script>
</head>
<body>
<form id="form1" runat="server">
        <asp:TextBox ID="RichTextBox" runat="server" TextMode = "MultiLine" ></asp:TextBox>
</form>
</body>
</html>
 
Above the lines marked in yellow are the ones used to configure the Spell Checker feature in ASP.Net.
spellchecker_rpc_url:'<%=ResolveUrl("~/TinyMCE.ashx?module=SpellChecker") %>'
 
You will notice that spellchecker_rpc_url has the same value (TinyMCE.ashx) that we have in the Web.Config path="TinyMCE.ashx" configuration key. This is important in order to make the spell checker work.
That’s it now your Spell Check is ready to run.
You can download the complete working source code using the link below.

TinyMCE_ASP.Net - SpellCheck Feature.zip










Related Articles



Comments



Add comments

You can add your comment about this article using the form below. Make sure you provide a valid email address
else you won't be notified when the author replies to your comment

Please note that all comments are moderated and will be deleted if they are
  • Not relavant to the article
  • Spam
  • Advertising campaigns or links to other sites
  • Abusive content.
Please do not post code, scripts or snippets.

Name*: Required
Email*: Required
Comment*: Required
Security code*: CaptchaInvalid Security Code
  Submit