This is a migrated thread and some comments may be shown as answers.

spell check in silent mode (i.e without modal dialog)

5 Answers 140 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Karunakar
Top achievements
Rank 1
Karunakar asked on 27 May 2008, 06:18 AM
Hi,

I am new to the rad editor spell check control. i hava a requirement that i want to do the spell check in silent mode i.e when i click on the spell check button it will do the spell check without showing the modal dialog. how can i do this?

i checked in the telerik forum but i could not find the answer  for this.

Can anybody help on this?

Regards,
Karunakar.

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 29 May 2008, 11:16 AM
Hi Karunakar,

It is not possible to SpellCheck, suing RadSpell, without showing the RadSpell dialog. Maybe the RadEditor's Ajax SpellChecker will meet your requirements. You can review it bellow:
http://www.telerik.com/demos/aspnet/prometheus/Editor/Examples/SpellChecker/DefaultCS.aspx


Sincerely,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sambasiva
Top achievements
Rank 1
answered on 30 May 2008, 08:04 AM
Hi George,

I am also having the same kind of scenario. The expected output is not like as shown in the the review link given by you.

var str = "This is a samplee tesst message for Spelll checking.";

On button click, i should known with an alert box that "string contains spell errors" or "no spell errors found".

my second question is,

User may or may not chage the content with the available suggestions while spell checking. Is there any way to find whether the content has been modified, after the specll cheker dialog box is dismissed.
0
George
Telerik team
answered on 02 Jun 2008, 01:42 PM
Hi Sambasiva,

We answered your other support ticket. For convenience I pasted the answer bellow:

You should be able to call the spell check service directly and then check if there are misspelled words in the response. For example:

<rad:SpellCheckService ID="SpellCheckService1" runat="server" />  
<script type="text/javascript">  
function check(textToCheck)  
{  
    var spellService = window["SpellCheckService1"];  
    var response;  
    spellService.SpellCheck(textToCheck,function(sender, args)  
{  
if (args && args.BadWords && args.BadWords.length>0)  
    alert ("String contains spell mistakes");  
else 
    alert ("No spell mistakes exists in the given string");  
});  
}  
</script> 

Note that, the SpellCheck service is asynchronous - this means that the alerts will be fired in a separate function, which is called after the spell response has been received.


The provided solution is for the ASP.NET version of the control, because you have pointed RadSpell for ASP.NET in the support ticket.

I hope this helps.

Sincerely,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Christopher
Top achievements
Rank 1
answered on 26 Sep 2011, 05:15 PM
This doesn't work in our version of the RadControls.  According to Visual Studio, there is no public ID property and no public methods on the SpellCheckService class in Telerik.Web.UI.dll, v4.0.30319. 
0
Lini
Telerik team
answered on 29 Sep 2011, 03:02 PM
Hello,

The code is for the classic (ASP.NET) version of RadSpell and you are using the new (ASP.NET AJAX) version. The control used in the example is not present in the new version, but you can write a quick workaround using the ASP.NET AJAX page methods feature. Here is some sample code for RadSpell for ASP.NET AJAX:

ASP.NET:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true" >
</telerik:RadScriptManager>
<script type="text/javascript">
    function check(textToCheck)
    {
        PageMethods.SpellCheck(textToCheck, checkFinished, checkError);
    }
    function checkError(error)
    {
        alert(error.get_message());
    }
    function checkFinished(errorCount)
    {
        if (errorCount && !isNaN(errorCount) && errorCount > 0)
            alert("String contains spell mistakes");
        else
            alert("No spell mistakes exists in the given string");
    }
</script>

//in your code file
[System.Web.Services.WebMethod]
public static int SpellCheck(string text)
{
    SpellChecker sc = new SpellChecker(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/RadSpell"));
    sc.Text = text;
    var errors = sc.CheckText();
    return errors.Count;
}


All the best,
Lini
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Spell
Asked by
Karunakar
Top achievements
Rank 1
Answers by
George
Telerik team
Sambasiva
Top achievements
Rank 1
Christopher
Top achievements
Rank 1
Lini
Telerik team
Share this question
or