Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Misc
Search the Knowledge Base
How can I use RapidSpellWInline with an ASP or HTML page - VERSION 3?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=265&catId=60

Options

Print this page
Email this to a friend

The information below is for VERSION 3 and VERSION 2

 

 

 

Provided you have .NET installed on the server, you can use RapidSpellWInline with legacy pages.  In this example we manually add the HTML & Javascript required to add inline spell checking to an ASP page.

The required blocks are marked with comments and blue, and the parts in bold are specific to the page;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <title></title>
  <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
  <meta name="ProgId" content="VisualStudio.HTML">
  <meta name="Originator" content="Microsoft Visual Studio .NET 7.1">
  
 
 <!-- RapidSpell Web Inline, Required external scripts and CSS -->
  <!-- Note, these are expected to be located in a virtual dir named Keyoti_RapidSpell_Web_Common-->
  <script type='text/javascript'>var oldEvt2 = document.onclick; document.onclick = function(ev) { if (oldEvt2) oldEvt2();var gEvent;if(window.event){gEvent=window.event;}else{gEvent=ev;}var gTar;if(gEvent.target){gTar=gEvent.target} else {gTar = gEvent.srcElement;}var gParent; if(gTar!=null && gTar.parentNode){gParent=gTar.parentNode;} else {gParent=gTar.parentElement;}if(gTar!=null && gTar.className!='rs_err_hl' && (gParent==null || gParent.className!='rs_err_hl')) rsw_hideCM(); } </script>
  <script type='text/javascript' src='/Keyoti_RapidSpell_Web_Common/inline.js'></script><script type='text/javascript'>rsw_rs_styleURL = '/Keyoti_RapidSpell_Web_Common/rs_style.css';</script>
  <LINK href='/Keyoti_RapidSpell_Web_Common/rs_style.css' type='text/css' rel='stylesheet'><LINK href='/Keyoti_RapidSpell_Web_Common/menu.css' type='text/css' rel='stylesheet'>
  <script>var oldEvt = window.onload; window.onload = function() { if (oldEvt) oldEvt(); rsw__init(); };</script>  
    <script>
function rsw_inline_button_OnStateChanged(state, buttonID, buttonTextSpellChecking, buttonTextSpellMode, buttonText){
var button = document.getElementById(buttonID);
if(button!=null && state=='TRANSITION-CHECKING'){ button.value=buttonTextSpellChecking; button.disabled = true;}
if(button!=null && state=='CHECKING'){ button.value=buttonTextSpellMode;button.disabled = false;}
if(button!=null && state=='EDITING'){ button.value=buttonText;button.disabled = false;}
}
  </script>

 </head>
 <body>
  <form>
   <textarea id="TextBox1" rows="11" cols="42" style="font-family: batang; font-size:10pt;">Hello firends of ASP</textarea>
   
   
   
   
  
<!-- Keyoti RapidSpell Web Inline Ctrl Config and button -->
  <span id="RapidSpellWInline1"><input name="RapidSpellWInline1:HAS_RUN" id="RapidSpellWInline1_HAS_RUN" type="hidden" value="false" /><script type='text/javascript'>
  var RapidSpellWInline1_SpellChecker = new SpellChecker('TextBox1');
  RapidSpellWInline1_SpellChecker.config =  {keys:['UserDictionaryFile', 'DictFile', 'SuggestionsMethod', 'LanguageParser','SeparateHyphenWords', 'V2Parser','SSLFriendlyPage', 'SuggestSplitWords','IncludeUserDictionaryInSuggestions', 'WarnDuplicates', 'IgnoreWordsWithDigits', 'CheckCompoundWords', 'LookIntoHyphenatedText', 'GuiLanguage','IgnoreXML', 'IgnoreCapitalizedWords', 'ConsiderationRange', 'IgnoreURLsAndEmailAddresses'],values:['C:\\Program Files\\Keyoti Inc\\RapidSpell Web .NET v3\\Demos\\C#\\user-dictionary.txt', '', 'HASHING_SUGGESTIONS', 'ENGLISH', 'False', 'True', '/Keyoti_RapidSpell_Web_Common/blank.html', 'True', 'True', 'True', 'True', 'False', 'True', 'ENGLISH', 'False', 'False', '500', 'True']};
  RapidSpellWInline1_SpellChecker.rapidSpellWebPage = "rswihelper.aspx";
  RapidSpellWInline1_SpellChecker.buttonID = "RapidSpellWInline1_RapidSpellWInline1__ctl0"
  RapidSpellWInline1_SpellChecker.showNoSpellingErrorsMesg = true;
  RapidSpellWInline1_SpellChecker.noSuggestionsText = 'No suggestions';
  RapidSpellWInline1_SpellChecker.ignoreAllText = 'Ignore All';
  RapidSpellWInline1_SpellChecker.addText = 'Add';
  RapidSpellWInline1_SpellChecker.editText = 'Edit...';
  RapidSpellWInline1_SpellChecker.changeAllText = 'All';
  RapidSpellWInline1_SpellChecker.showChangeAllItem = false;
  RapidSpellWInline1_SpellChecker.removeDuplicateText = 'Remove duplicate word';
  RapidSpellWInline1_SpellChecker.buttonTextSpellChecking = 'Checking...';
  RapidSpellWInline1_SpellChecker.buttonTextSpellMode = 'Resume Editing';
  RapidSpellWInline1_SpellChecker.buttonText = 'Inline Spell Check';
  RapidSpellWInline1_SpellChecker.noSpellingErrorsText = 'No Spelling Errors In Text.';
  RapidSpellWInline1_SpellChecker.responseTimeout = '20';
  RapidSpellWInline1_SpellChecker.responseTimeoutMessage = 'Sorry the server has failed to respond to the spell check request.  Please check the URL set in the RapidSpellWInlineHelperPage property in the RapidSpellWInlineHelper ctrl.';
  RapidSpellWInline1_SpellChecker.changeButtonTextWithState = true;
  RapidSpellWInline1_SpellChecker.showAddMenuItem = true;
  RapidSpellWInline1_SpellChecker.hasRunFieldID = "RapidSpellWInline1_HAS_RUN";
  RapidSpellWInline1_SpellChecker.doubleClickSwitchesMode = true;
  RapidSpellWInline1_SpellChecker.useXMLHTTP = true;
  RapidSpellWInline1_SpellChecker.ignoreXML = false;
  RapidSpellWInline1_SpellChecker.enterStaticSpellCheckListener = '';
  RapidSpellWInline1_SpellChecker.leaveStaticSpellCheckListener = '';
  RapidSpellWInline1_SpellChecker.tbInterface = new RSStandardInterface("TextBox1");
  rsw_scs[rsw_scs.length] = RapidSpellWInline1_SpellChecker;
  </script>
  <input name="RapidSpellWInline1:RapidSpellWInline1__ctl0" id="RapidSpellWInline1_RapidSpellWInline1__ctl0" type="button" value="Inline Spell Check" onClick="RapidSpellWInline1_SpellChecker.OnSpellButtonClicked()" ID="RapidSpellWInline1_RapidSpellWInline1__ctl0" /></span>   
  <!-- Required hidden elements, should come after above JS block-->
  <iframe style='height:0px; width:0px;visibility:hidden;' id="rswinline" name="rswinline" src="/Keyoti_RapidSpell_Web_Common/blank.html"></iframe>
  <div id='TextBox1_D' class='oldBrowserBox' style='display:none;width:400px; height:300px;position:absolute;'></div>
  <!-- End required elements -->

 

  </form>
 </body>
</html>

To use this example, you will also need to place a file called rswihelper.aspx in the same directory (note it's name & path is specified in the code above).

<%@ Page language="c#"  validateRequest="false"%>
<%@ Register TagPrefix="rapidspellweb" Namespace="Keyoti.RapidSpell" Assembly="Keyoti.RapidSpellWeb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <RapidSpellWeb:RapidSpellWInlineHelper id="RapidSpellWInlineHelper1"  runat="server"></RapidSpellWeb:RapidSpellWInlineHelper>
  </form>
 </body>
</HTML>

The parts marked in bold may need to be modified to work with your specific page - in particular "TextBox1" is the id of the text box we want to check.

Tips:

The textarea or input field must have an ID (just a name wont work)

Explicitly setting the font style in the text box allows the inline control to copy the font in spell check mode.

If your form is complex, or if you have a 3rd party control on the form, it may be best to create a mockup of the form in ASP.NET first, and then copy our blocks over to the ASP page, once you have it working.

The virtual directory Keyoti_RapidSpell_Web_Common is created by our installer, and will need to be copied to your server (putting it in the root (wwwroot) of the web-site should work fine).

If you haven't already placed our DLLs in a location where they will be found by ASP.NET you will need to;

i. create a folder named 'bin' off of 'wwwroot'

ii. copy Keyoti.RapidSpell.DLL and Keyoti.RapidSpellWeb.DLL from C:\Program Files\Keyoti Inc\RapidSpell Web .NET v3 to your new 'bin' folder.  If you can't find Keyoti.RapidSpellWeb.DLL you will need to reinstall and choose to install for .NET 1.

 

If you have questions or difficulty please email support@keyoti.com

 

This article is designed for 'RapidSpell Web ASP.NET' users.

RapidSpell Web ASP.NET allows developers to add spell checking to ASP.NET web sites.

 


Related Questions:

Attachments:

No attachments were found.