SpellServer.NET Overview Documentation
Using SpellServer in ASP.NET
Sample Applications Overview
SpellServer is a class library for .NET, and as such, it provides a number of methods and properties that can be
used to check spelling. However, simply having a class library isn't enough, so we provide two complete working
ASP.NET applications with SpellServer - one in VB.NET, and one in C#.
You can examine these sample applications and use them as examples while
writing your own application, or you can easily integrate the main ASP.NET spell checking page from either sample
(correct.aspx) into your application.
Our sample application is comprised of three pages:
| InitialPage.aspx |
The initial data entry page. This page will typically be
replaced by a page in your current web application, as it serves only to
collect the text that should be checked. |
| Correct.aspx |
The main spell checking page in the application. This page uses
SpellServer.NET to search for the next misspelled word, and then to present
that word, its suggested replacement strings, and various possible actions for
the user to take. When the entire string has been spell-checked, this
page forwards the user to the next page of your application (in the case of
this demonstration, we use the Finish.aspx page). |
| Finish.aspx |
This page serves only to display the final results of the spell-checking.
It will always be replaced with your own page (one that continues processing
with the now spell-checked text). |
Examining the VB.NET Sample Application in Visual Studio.NET
Note that both ASP.NET sample applications use "src=" in the ASPX files, rather than
"CodeBehind=". This is
because some ASP.NET programmers do not use Visual Studio.NET. If you are planning on using VS.NET, you may
wish to change "src=" in the *.ASPX files to "CodeBehind=" to help
VS.NET handle the project properly.
To open the sample VB.NET project in Visual Studio.NET, you need to do the following steps:
1. Once you start VS.NET, go to File - Open - Project From Web.
2. In the URL text box, type in http://localhost/SpellServerNETDemoVB/,
then select
svnetdemo.vbproj.
3. In the Solution Explorer, right-click on InitialPage.aspx and choose
Set As Start Page.
4. Change "src=" to "CodeBehind=" in
the "<@Page" part of InitialPage.aspx,
Correct.aspx, and Finish.aspx.
Examining the C# Sample Application in Visual Studio.NET
Note that both ASP.NET sample applications use "src=" in the ASPX files, rather than
"CodeBehind=". This is
because some ASP.NET programmers do not use Visual Studio.NET. If you are planning on using VS.NET, you may
wish to change "src=" in the *.ASPX files to "CodeBehind=" to help
VS.NET handle the project properly.
To open the sample C# project in Visual Studio.NET, you need to do the following steps:
1. Once you start VS.NET, go to File - Open - Project From Web.
2. In the URL text box, type in http://localhost/SpellServerNETDemoCSharp/, then
select SpellServerNETDemoCSharp.csproj.
3. In the Solution Explorer, right-click on InitialPage.aspx and choose
Set As Start Page.
4. Change "src=" to "CodeBehind=" in
the "<@Page" part of InitialPage.aspx,
Correct.aspx, and Finish.aspx.
Integrating Correct.aspx Into Your Application
The main page in the sample application is Correct.aspx. This page can easily
be integrated into your own application by following these steps:
1. At some point in your existing application, you will have some text you wish to spell-check. Perhaps
your application allows the user to enter text into a text box, or maybe you retrieve or construct some text based
on user input. At the point that you've assembled or collected the text, you need to pass this text into the
Correct.aspx page. There are two approaches to getting the text into this page:
1a. If you wish to pass in the text via a form post,
you'll need to modify the INPUT_FIELD_NAME constant located
at the top of Correct.aspx.vb or Correct.aspx.cs.
For example, if your application
page uses a <TEXTAREA> tag named txaUserComments for the text you wish checked, you will need to change
the INPUT_FIELD_NAME constant to be "txaUserComments". The page will then retrieve
the data via Request.Form.
1b. If you don't wish to post the text to Correct.aspx
(for example, if the text can be retrieved from a data source),
you can retrieve or contruct the data in the page itself. To do this, simply redirect flow to
Correct.aspx, and modify
the Correct.aspx.vb or Correct.aspx.cs file
to get the initial text (comments in the file show which lines will need to be changed).
2. If you wish to check spelling in UK English, French, or Spanish, set the Language property
The Language property can be "US", "UK", "FR" or "SP".
3. If you are using the retail version of SpellServer, be sure to set the CompanyName property to match
the value you entered during installation. Also, ensure that SpellServer*.bdc and SpellServer*.dat files are
located in the bin folder of your application.
4. If you wish to change the look of the correction page, modify the styles
either by changing the <LINK> tag to point to your own
CSS file, or by modifying the styles stored in SpellServer's CSS file. Another option would be to place
the styles into the Correct.aspx file itself,
although this approach isn't as flexible as using a CSS file.
5. Add a reference to
SpellServer.NET to your ASP.NET application. You may wish to add the
following lines to the Web.Config file, inside the <Config> tags:
<compilation defaultLanguage="vb" debug="true">
<assemblies>
<add assembly="SpellServer.NET, Version=2.0, culture=neutral, publickeytoken=bf4f42a68db83050"/>
</assemblies>
</compilation>
Deployment
One of the benefits that the .NET framework provides is ease of deployment. Installing the SpellServer
library is as simple as copying the SpellServer.NET.dll file into a folder
on your web server, and adding a reference to it in your ASP.NET application. We recommend that you set
"Copy Local" to True in the properties page of the reference.
Also, ensure that the language-specific SpellServer*.bdc (and SpellServer*.dat, for the retail version of the
product) files are located in the bin folder of your application.
Technical Support
Chado Software stands behind its products. We offer free lifetime technical support for our products
(details are available on our web site). Be sure to check our web site for updates to SpellServer and
new technical information, and also use it to contact our technical support team if needed.
www.chado-software.com
|