Note: This article is for users of version 3.4.0 and lower. Version 3.4.1 and above support multiple RapidSpellWebMultiple controls. It may be desirable to have more than one button on a page, where each button spell checks configurable groups of text boxes. To acheive this effect place one RapidSpellWebMultiple on the page, configure it to check all the text boxes on the page. Hide the RapidSpellWebMultiple control by setting ShowButton='false'. Add regular Button controls on the page, each button will launch the spell checker for each group of text boxes. The serverside code for the button will configure the RapidSpellWebMultiple control to spell check the desired group of text boxes. This example requires 'popup.aspx' from our demo projects that came with the product. Example Code - MultipleMultipleTextBoxes.aspx <%@ Page language="c#" Codebehind="MultipleMultipleTextBoxes.aspx.cs" AutoEventWireup="false" Inherits="RapidSpellWeb_Demo_CSharp.MultipleMultipleTextBoxes" %> <%@ Register TagPrefix="rapidspellweb" Namespace="Com.Keyoti.RapidSpell" Assembly="Keyoti.RapidSpellWeb" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>MultipleTextBoxes</title> <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="MultipleTextBoxes" method="post" runat="server"> <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 21px; POSITION: absolute; TOP: 65px" runat="server" TextMode="MultiLine" Width="404px" Height="127px" Columns="40" Rows="4">This example demenstrates</asp:TextBox> <asp:Label id="Label1" style="Z-INDEX: 108; LEFT: 21px; POSITION: absolute; TOP: 31px" runat="server" Font-Names="Arial">Multiple, multiple text box checking with one button each</asp:Label> <asp:TextBox id="TextBox2" style="Z-INDEX: 102; LEFT: 21px; POSITION: absolute; TOP: 201px" runat="server" TextMode="MultiLine" Width="404px" Height="127px" Columns="40" Rows="4">multiplemultiple textbox checking r controls (using the pop-up chooser) </asp:TextBox> <asp:TextBox id="TextBox3" style="Z-INDEX: 103; LEFT: 21px; POSITION: absolute; TOP: 335px" runat="server" Width="259px" Columns="40">Any combination of text boexs on a form</asp:TextBox> <rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher2" style="Z-INDEX: 104; LEFT: 435px; POSITION: absolute; TOP: 213px" runat="server" TextComponentName-Length="8" TextComponentName="TextBox2" RapidSpellWebPage-Length="10" RapidSpellWebPage="PopUp.aspx" CreatePopUpWindow="False" PopUpWindowName-Length="31" PopUpWindowName="RapidSpellWebMultiple1_PopUpWin" ShowFinishedMessage="False" ShowNoErrorsMessage="False" FinishedListener-Length="33" FinishedListener="RapidSpellWebMultiple1_NotifyDone" ShowButton="False" RSMultipleID-Length="22" RSMultipleID="RapidSpellWebMultiple1"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebLauncher>
<rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher3" style="Z-INDEX: 105; LEFT: 294px; POSITION: absolute; TOP: 339px" runat="server" TextComponentName-Length="8" TextComponentName="TextBox3" RapidSpellWebPage-Length="10" RapidSpellWebPage="PopUp.aspx" CreatePopUpWindow="False" PopUpWindowName-Length="31" PopUpWindowName="RapidSpellWebMultiple1_PopUpWin" ShowFinishedMessage="False" ShowNoErrorsMessage="False" FinishedListener-Length="33" FinishedListener="RapidSpellWebMultiple1_NotifyDone" ShowButton="False" RSMultipleID-Length="22" RSMultipleID="RapidSpellWebMultiple1"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebLauncher>
<rapidspellweb:RapidSpellWebMultiple id="RapidSpellWebMultiple1" style="Z-INDEX: 106; LEFT: 611px; POSITION: absolute; TOP: 73px" runat="server" RapidSpellWebLaunchers="RapidSpellWebLauncher1,RapidSpellWebLauncher2,RapidSpellWebLauncher3,RapidSpellWebLauncher4,RapidSpellWebLauncher5" ShowButton="False"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebMultiple>
<rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher1" style="Z-INDEX: 107; LEFT: 438px; POSITION: absolute; TOP: 75px" runat="server" TextComponentName-Length="8" TextComponentName="TextBox1" RapidSpellWebPage-Length="10" RapidSpellWebPage="PopUp.aspx" CreatePopUpWindow="False" PopUpWindowName-Length="31" PopUpWindowName="RapidSpellWebMultiple1_PopUpWin" ShowFinishedMessage="False" ShowNoErrorsMessage="False" FinishedListener-Length="33" FinishedListener="RapidSpellWebMultiple1_NotifyDone" ShowButton="False" RSMultipleID-Length="22" RSMultipleID="RapidSpellWebMultiple1"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebLauncher>
<!--text box group 2--> <asp:TextBox id="TextBox4" style="Z-INDEX: 109; LEFT: 598px; POSITION: absolute; TOP: 174px" runat="server"></asp:TextBox> <asp:TextBox id="TextBox5" style="Z-INDEX: 110; LEFT: 599px; POSITION: absolute; TOP: 217px" runat="server"></asp:TextBox>
<rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher4" style="Z-INDEX: 111; LEFT: 766px; POSITION: absolute; TOP: 179px" runat="server" RapidSpellWebPage="popup.aspx" RapidSpellWebPage-Length="10" TextComponentName="TextBox4" TextComponentName-Length="8" RSMultipleID-Length="22" RSMultipleID="RapidSpellWebMultiple1"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebLauncher>
<rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher5" style="Z-INDEX: 112; LEFT: 767px; POSITION: absolute; TOP: 218px" runat="server" RapidSpellWebPage="popup.aspx" RapidSpellWebPage-Length="10" TextComponentName="TextBox5" TextComponentName-Length="8" RSMultipleID-Length="22" RSMultipleID="RapidSpellWebMultiple1"> <Button BorderWidth="" BorderColor="" ForeColor="" BackColor="" Height="" Width="" CssClass="" type="button" value="Check Spelling"></Button> </rapidspellweb:RapidSpellWebLauncher>
<asp:Button id="Button1" style="Z-INDEX: 113; LEFT: 24px; POSITION: absolute; TOP: 374px" runat="server" Text="Spell Check"></asp:Button> <asp:Button id="Button2" style="Z-INDEX: 114; LEFT: 600px; POSITION: absolute; TOP: 263px" runat="server" Text="Spell Check"></asp:Button> </form> </body> </HTML>
Code behind - MultipleMultipleTextBoxes.aspx.cs (VB.NET users please email us if unable to understand this code) using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;namespace RapidSpellWeb_Demo_CSharp{ /// <summary>/// Summary description for MultipleTextBoxes./// </summary>public class MultipleMultipleTextBoxes : System.Web.UI.Page{ protected System.Web.UI.WebControls.TextBox TextBox1;protected System.Web.UI.WebControls.TextBox TextBox2;protected System.Web.UI.WebControls.TextBox TextBox3;protected Com.Keyoti.RapidSpell.RapidSpellWebLauncher RapidSpellWebLauncher2;protected Com.Keyoti.RapidSpell.RapidSpellWebLauncher RapidSpellWebLauncher3;protected Com.Keyoti.RapidSpell.RapidSpellWebLauncher RapidSpellWebLauncher1;protected System.Web.UI.WebControls.Label Label1;protected System.Web.UI.WebControls.TextBox TextBox4;protected System.Web.UI.WebControls.TextBox TextBox5;protected Com.Keyoti.RapidSpell.RapidSpellWebLauncher RapidSpellWebLauncher4;protected Com.Keyoti.RapidSpell.RapidSpellWebLauncher RapidSpellWebLauncher5;protected System.Web.UI.WebControls.Button Button1;protected System.Web.UI.WebControls.Button Button2;protected Com.Keyoti.RapidSpell.RapidSpellWebMultiple RapidSpellWebMultiple1;private void Page_Load(object sender, System.EventArgs e){ // Put user code to initialize the page here} #region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){ //// CODEGEN: This call is required by the ASP.NET Web Form Designer.//InitializeComponent(); base.OnInit(e);} /// <summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){ this.Button1.Click += new System.EventHandler(this.Button1_Click);this.Button2.Click += new System.EventHandler(this.Button2_Click);this.Load += new System.EventHandler(this.Page_Load);} #endregion private void Button1_Click(object sender, System.EventArgs e){ //configure launcher 1this.RapidSpellWebMultiple1.RapidSpellWebLaunchers = new Com.Keyoti.RapidSpell.RapidSpellWebLauncherCollection("RapidSpellWebLauncher1,RapidSpellWebLauncher2,RapidSpellWebLauncher3");//start launcherPage.RegisterClientScriptBlock("RSWEB", "<script>function runSpell(){"+RapidSpellWebMultiple1.ClientID+"_RunSpellCheck(true);}window.onload=runSpell;</script>"); } private void Button2_Click(object sender, System.EventArgs e){ //configure launcher 2this.RapidSpellWebMultiple1.RapidSpellWebLaunchers = new Com.Keyoti.RapidSpell.RapidSpellWebLauncherCollection("RapidSpellWebLauncher4,RapidSpellWebLauncher5");//start launcherPage.RegisterClientScriptBlock("RSWEB", "<script>function runSpell(){"+RapidSpellWebMultiple1.ClientID+"_RunSpellCheck(true);}window.onload=runSpell;</script>"); } } } |