THEMES
THEME SETTINGS

Spell Checker Overview



About the Spell Checker

The Spell Checker provides you a straightforward way in which to add Microsoft Office style spell checking capabilities into your next ASP.NET MVC application and offers you built in suggestion forms that replicate corresponding forms found in Microsoft Outlook. These forms will seamlessly integrate into any web application powered by DevExpress.

To add a spell checker to your project, declare the ASP.NET MVC Spell Checker extension in the Partial View and define how the callbacks will be routed back to your controller using the CallbackRouteValues property. Specify the default culture and the ID of the text control being cheсked. To add the ISpell dictionary, use the AddISpellDictionary method and specify the path to the dictionary file, the grammar file and the alphabet file. A dictionary should indicate its culture and character encoding. The CacheKey identifier enables you to access the dictionary using the Session[Dictionary.CacheKey] object.

You can subscribe to spellchecker events to perform certain actions before and after check:

Partial View code:

@Html.DevExpress().SpellChecker(settings => {
    settings.Name = "spellChecker";
    settings.CallbackRouteValues = new { Action = "OverviewPartial", Controller = "Overview" };

    settings.CheckedElementID = "textBox";
    settings.Culture = new CultureInfo("en-US");
    settings.Dictionaries.AddISpellDictionary(d => {
        d.AlphabetPath = "~/Dictionaries/EnglishAlphabet.txt";
        d.GrammarPath = "~/Dictionaries/english.aff";
        d.DictionaryPath = "~/Dictionaries/american.xlg";
        d.CacheKey = "ispellDic";
        d.Culture = new CultureInfo("en-US");
        d.EncodingName = "Western European (Windows)";
    });

    settings.ClientSideEvents.BeforeCheck = "function(){ $('#checkSpellingButton').attr('disabled','disabled');; }";
    settings.ClientSideEvents.AfterCheck = "function(){ $('#checkSpellingButton').removeAttr('disabled'); }";
}).GetHtml()


To start the check, use the SpellChecker.Check method:

View code:

<script type="text/javascript">
$(document).ready(function(){
    $("#checkSpellingButton").click(function(){
        spellChecker.Check();
    });
});
</script>

@Html.Partial("OverviewPartial")

<input id="checkSpellingButton" type="button" value = "Check Spelling ..." />
<br />
<br />
@Html.TextArea("textBox", Model, new { style = "width: 100%; height: 150px;"})

Key Features
  • Multiple Dictionary Formats

    Supports Ispell, OpenOffice and Hunspell dictionary formats. Enables the user to add words to a custom dictionary.

  • Ready-to-Use Spelling Dialogs

    A Microsoft Office style error indication dialog, a spelling options editor and dictionary dialogs that allow end-users to add unrecognized words to a custom dictionary.

  • Spelling Options

    Spell checker options allow you to ignore emails, URLs, mixed case/upper-case words, repeated words and words with numbers within them.

Version: v2016 vol 2.5
Copyright © 2006-2017 Developer Express Inc
Your Next Great MVC App Starts Here

Get started today and download your 30-day trial of DevExpress MVC Extensions (includes 30 days of free technical support).

All demos ship with full source code and are included in the DevExpress MVC distribution. Refer to the Demos and Sample Applications topic to learn more.

DevExpress MVC Extensions ship as part of DevExpress Universal, DXperience and ASP.NET Subscriptions and are backed by a 60 day unconditional money-back guarantee.
To learn more and obtain pricing information, visit the Compare Features and Pricing webpage. For immediate assistance, contact us by Email at info@devexpress.com or by phone at +1 (818) 844-3383 between 7:30am and 4:30pm Pacific Time.