Friday, 1 October 2004
08:43 AM
Jeff Atwood has made available a custom ASP.NET server contol (source included) that implements CAPTCHA anti-bot protection to Web pages. A canonical use would be to add the control to your blog comment submission page; users have to type in a sequence of characters generated by the control in order for the post to be submitted. Like this:

(That's an image of the control, not the control itself.)
As he promises in his post, it's easy to use -- add as a custom control to your site/project, add an element to your Web.config, and go. The control does all the work of generating the image and checking it on postback. As with validators, all you have to do is test the control's UserValidated property to determine whether the user got it right.
My only issue with CAPTCHA generally is that the algorithm used to distort the secret text sometimes warps it so much that it can be hard to make out the characters. However, that's an issue with the way the image generation works (and I've seen this in other examples of the same technique), not any criticism of the control itself.
[categories]
aspnet
|
link
|