Error using SpellChecker in code behind

2 posts, 0 answers
  1. Martin Sherene
    Martin Sherene avatar
    3 posts
    Member since:
    Dec 2008

    Posted 14 Jan 2011 Link to this post

    I'm trying to use the Telerik.Web.UI.SpellChecker object to check some text server side, but keep getting the following error in the process: "No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/".  I have two samples of code, both of which result in the same error being thrown.

    Case 1:
    SpellChecker spellChecker = new SpellChecker("~/App_Data/RadSpell");
    spellChecker.Text = "Some sample text tecct";
    SpellCheckErrors errors = spellChecker.Errors;

    Case 2:
    SpellChecker spellChecker = new SpellChecker("~/App_Data/RadSpell");
    spellChecker.Text = "Some sample text tecct";
    SpellCheckErrors errors = spellChecker.CheckText();

    I've verified that the dictionary files do exist within the ~/App_Data/RadSpell directory, and they even get loaded into the SpellChecker object (I stepped through the debugger and used the immediate window to get values for spellChecker.CustomDictionarySource.DictionaryPath and spellChecker.CustomDictionarySource.Language:
    spellChecker.CustomDictionarySource.DictionaryPath
    "~/App_Data/RadSpell"
    spellChecker.CustomDictionarySource.Language
    "en-US"

    These values seem to get set only after I have set the Text value of the SpellChecker object; prior to that (and just after creating the object), these values are null.

    I'm using version 2010.3.1109.35 of the Telerik.Web.UI library for .Net 3.5.

    Thanks for your help.
  2. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 19 Jan 2011 Link to this post

    Hi Martin,

    You should set the path using the Server.MapPath method:

    SpellChecker spellChecker = new SpellChecker(Server.MapPath("~/App_Data/RadSpell"));
    spellChecker.Text = "Some sample text tecct";
    SpellCheckErrors errors = spellChecker.Errors;



    Greetings,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top