RadSpell Event delegation

2 posts, 0 answers
  1. Jagadeesh Maneri
    Jagadeesh Maneri avatar
    1 posts
    Member since:
    May 2010

    Posted 07 May 2010 Link to this post

    Hi,

    I am new to telerik implementation. In my current project which is running on .net feramework 3.5/VS2008/RadControls for ASP.NET AJAX Q1 2010 is having a requirement where I need to spell check a series of textbox controls and save to database. I am able to do this in two steps where I am asking user to first click on "Spell Check" button and then click again on "Save" button. Is it possible to delegate the spell check click event to this "Save" button?

    I am trying to do like this:
    Suggest me if I need to make any changes in the script.
    <script language="javascript" type="text/javascript">  
     function spellCheck() {  
          var radSpell = GetRadSpell('<%= radSpellChecker.ClientID %>');  
          radSpell.StartSpellCheck();  
     }  
    </script> 
     
    <telerik:RadSpell ID="radSpellChecker" runat="server" ButtonType="None" IsClientID="True" /> 
    <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /> 

    And in the code behind, I am adding this below statement in Page_Load event.
    this.btnSave.Attributes.Add("onClick""return spellCheck();"); 

    I tried setting up the RadControlsDir property for the spell checker with the path to a folder that contains spell folder with 3 scripts present in a "Scripts" folder.

    Please suggest me the chagnes requried and also if any configuration settings are to be made.

    Thanks,
    Jagadeesh
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 12 May 2010 Link to this post

    Hello,

    The problem in the code you sent is that the button will initiate a postback before finishing the SpellCheck.
    My suggestion is to use the built in RadSpell button(ButtonType="PushButton"), handle the OnClientCheckFinished client-side event and create postback(to save the spelled text) via JavaScript(__doPostBack method).

    Greetings,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top