Spell - Spellchecking Selections

Select some text in the textarea and click "Spellcheck".

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

Spellchecking a text selection is merely a matter of defining the appropriate text source implementation. 

In this example we define the TextSource's get_text() method to obtain the text from the currently selected text in the textarea. set_text() replaces the selection with the corrected text.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
<%@ Page  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script type="text/javascript" src="Scripts.js"></script>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-narrow">
        <h4>Select some text in the textarea and click "Spellcheck".</h4>
        <textarea id="textBox1" style="width:100%; height: 100px;">Thisz is a server side TextBox with some delibirate mistakees.</textarea>
        <br />
        <telerik:RadSpell RenderMode="Lightweight" ID="spell1" runat="server" ButtonType="None"></telerik:RadSpell>
        <button onclick="spellCheck('<%= spell1.ClientID %>'); return false;">
        <br />

Find Assistance

Help Us Improve

Was this example helpful?