Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Spell > spell check in silent mode (i.e without modal dialog)

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

Feed from this thread
  • Karunakar avatar

    Posted on May 27, 2008 (permalink)

    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.

    Reply

  • George George admin's avatar

    Posted on May 29, 2008 (permalink)

    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

    Reply

  • Sambasiva avatar

    Posted on May 30, 2008 (permalink)

    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.

    Reply

  • George George admin's avatar

    Posted on Jun 2, 2008 (permalink)

    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

    Reply

  • Christopher avatar

    Posted on Sep 26, 2011 (permalink)

    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. 

    Reply

  • Lini Lini admin's avatar

    Posted on Sep 29, 2011 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Spell > spell check in silent mode (i.e without modal dialog)
Related resources for "spell check in silent mode (i.e without modal dialog)"

ASP.NET Spell Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer Step-by-step Tutorial  ]