Server-Side SpellCheck using RadSpell

Article Info

Rating: 5

Article information

Article relates to

 RadSpell for ASP.NET AJAX

Created by

 Georgi Popivanov


HOW-TO 
SpellCheck custom text on the Server.

SOLUTION
Sometimes it is useful to execute a silent SpellCheck on the server and determine whether there are spelling mistakes in the text. The code bellow demonstrates how to achieve this functionality:
protected void Page_Load(object sender, EventArgs e)  
{  
    SpellChecker spell = new SpellChecker(Server.MapPath("~/App_Data/RadSpell"));  
    spell.Text = "Textt to Checkk";  
    spell.CheckText();  
    SpellCheckErrors errors = spell.Errors;  
    foreach (SpellCheckError error in errors)  
    {  
        Page.Response.Write(error.MistakenWord.ToString()+"</br>");  
    }  

Note that, the "Server.MapPath("~/App_Data/RadSpell")" is the path to the dictionaries' folder.

Comments

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.