In the following exampleRapidSpell Web ASP.NET is integrated with TX Text Control’s web version. To do this we used a custom text interface, registered viarapidSpell.textInterfaceNeeded. The content is HTML encoded,so we set IgnoreXML to true, and also prevent dangerous request warnings bysetting in web.config <httpRuntime targetFramework="4.5" requestValidationMode="2.0" /> Note that you can also avoid this warning by using the floating DIV based dialog window: call rapidSpell.dialog_setUseDivDialog(true); <%@ Page Language="vb" AutoEventWireup="false" ValidateRequest="true" CodeBehind="WebForm1.aspx.vb" Inherits="Check.WebForm1" %> <%@ Register Assembly="TXTextControl.Web,Version=24.0.400.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638" Namespace="TXTextControl.Web" TagPrefix="cc1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="Keyoti_RapidSpell_Web_Common/RapidSpell-DIALOG.js"></script> <script type="text/javascript"> //textBoxId is thetextbox to be spell checked //mode is either'dialog' or 'ayt', indicating the type of spell check occurring rapidSpell.textInterfaceNeeded = function (textBoxId, mode) {return newRSCustomInterface(textBoxId);} rapidSpell.setParameterValue('default', 'IgnoreXML', true); var textControlHTML; function spellCheck(tb) { //callsave, and from its callback initiate spell check TXTextControl.saveDocument(TXTextControl.StreamType.HTMLFormat, function (e) { textControlHTML = e.data; rapidSpell.dialog_spellCheck(true, tb); }); } functionRSCustomInterface(tbElementName) { this.tbName =tbElementName; this.getText = getText; this.setText = setText; function getText() { //returnthe text from the text component named this.tbName, //thismay be HTML formatted text return textControlHTML; } function setText(text) { //set thetext in the text component to the text argument //thismay be HTML formattedtext var encoded =btoa(text); // btoa base-64-encodes strings. TXTextControl.loadDocument(TXTextControl.StreamType.HTMLFormat, encoded); } } </script> </head> <body> <form id="form1" runat="server"> <div> <cc1:TextControl ID="TextControl1" runat="server" /> <input id="Button2" type="button" value="Spell Check" onclick="spellCheck('TextControl1')" /> </div> </form> </body> </html> |