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

6 posts, 0 answers
  1. Karunakar
    Karunakar avatar
    1 posts
    Member since:
    May 2008

    Posted 27 May 2008 Link to this post

    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.
  2. George
    Admin
    George avatar
    859 posts

    Posted 29 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sambasiva
    Sambasiva avatar
    45 posts
    Member since:
    May 2008

    Posted 30 May 2008 Link to this post

    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.
  5. George
    Admin
    George avatar
    859 posts

    Posted 02 Jun 2008 Link to this post

    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
  6. Christopher
    Christopher avatar
    1 posts
    Member since:
    Sep 2011

    Posted 26 Sep 2011 Link to this post

    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. 
  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 29 Sep 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017