Who hasn't built a website and had people putting garbage in the "Contact Us" form? The new version of this website, Blogiversity.org, wasn't live two days before I started receiving trash through the "Contact Us" form. I decided it was time to investigate ways to make sure it was a human filling out and submitting the form. As usual, I wanted to find a control that someone else had built and was giving away from free. God bless the internet and programmers who are very willing to share their experiences!
I found a wonderful solution for a CAPTCHA server control for ASP.NET that can be downloaded here. The article does an excellent job of explaining how it works. I had a few concerns about whether I would be able to implement this CAPTCHA control into the Community Server program (CS2007), but I had it up and running well very quickly. All it required was the following steps:
-
Put the WebControlCaptcha.dll file in the bin directory.
-
Add the following to the web.config file under httpHandlers:
<add verb="GET" path="CaptchaImage.aspx" type="WebControlCaptcha.CaptchaImageHandler, WebControlCaptcha"/>
-
Put a Captcha contol and a Validate Summary control on the webpage. I didn't even have to change any of the default settings.
<cc1:CaptchaControl ID="CaptchaControl1" runat="server" />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
-
Add a reference to the assembly at the top of the webpage.
<%
@ Register Assembly="WebControlCaptcha" Namespace="WebControlCaptcha" TagPrefix="cc1" %>
It works beautifully. I have not had any trash posts since it was installed.