I was checking the other day different ways to create a spell checker for a nice web part I was doing in Sharepoint 2010. I have been trying jQuery spell checkers, but to be honest, they all look quite clunky, in fact most of them work outside Sharepoint but as soon as you try to use them in your webpart, become unstable. If fact, a couple of them work “sometimes” what is the last thing you want when you have to deliver a project to a client.
I heard about Sharepoint Spell Checker, so I start doing some research, I have found a couple of posts on Internet, but they didn’t work either, the closest one comes from “Cherry Bytes” (thanks for sharing the info) and it was for MOSS 2007, so I tried to make it work.
Follow my five steps and in less than 2 minutes, you will have it done!
Add the following line on the top of the page:
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Add this line after all the “Registers”… almost top of the page:
Add a button to do the spell checking:
Add two textboxes. The first one will be checked by our spell checker, but the second one will be avoided because of the “excludeFromSpellCheck” set it to true:
<asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox><asp:TextBox ID="TextBox1" runat="server" CssClass="ms-long" excludeFromSpellCheck="true"></asp:TextBox>
Probably this is not the most elegant solution in terms of coding, but if we are using Sharepoint as a platform, it is quite good to use native web services instead of third party solutions…and it looks neat!