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

RadSpell Event delegation

1 Answer 80 Views
This is a migrated thread and some comments may be shown as answers.
Jagadeesh Maneri
Top achievements
Rank 1
Jagadeesh Maneri asked on 07 May 2010, 08:24 AM

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 %>');  
<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.


1 Answer, 1 is accepted

Sort by
Petio Petkov
Telerik team
answered on 12 May 2010, 12:57 PM

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).

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.
Asked by
Jagadeesh Maneri
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Share this question