After much research and consideration I decided to use reCAPTCHA and the reCAPTCHA ASP.NET library.
Step 1 - Create a free account
http://www.google.com/recaptcha
Step 2 - Download the reCAPTCHA ASP.NET library
http://code.google.com/apis/recaptcha/docs/aspnet.html
I'm using the .Net control but as you'll see it has plugins for several platforms.
To get it working was just a matter of referencing the library in my project, dropping the control on my page and referencing the public/private keys generated in step 1.
I can't find the aspnet library anywhere! It is not available in the google downloads!?! Any ideas / help?!?!
ReplyDeleteLooks like their link is not quite right, so I had to take out the search criteria and then it worked fine. Try this direct link:
ReplyDeletehttp://code.google.com/p/recaptcha/downloads/list?can=2&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
yeah, but which one do I need for aspx ?
ReplyDeleteI am using the current release, which is "reCAPTCHA .NET Library v1.0.5.0 Binary Only"
ReplyDeleteok..you're going to be sorry now you replied back so quickly!! :)
ReplyDeleteCan you give me more precise instructions on how to actually get the thing to work and add the catpcha quetion to my form!?!
I'm a real novice here and this has being driving me crazy all day!!
The first thing you need to do is add a reference in your web project to the Recaptcha.dll that you extracted from the download.
ReplyDeleteThen you will want to register the assembly on the .aspx page.
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
Next place the control on your page wherever you want it to show up.
< recaptcha:RecaptchaControl ID="recaptcha" PublicKey="YourPublicKey" PrivateKey="YourPrivateKey" Theme="white" runat="server" />
If you don't have a public/private key yet you can get one from http://www.google.com/recaptcha
Then use a button (or whichever control you want) to initiate your postback.
< asp:Button id="btnSubmit" Text="Submit" runat="server" />
Then have some kind of postback event in your code-behind to validate the postback.
Private Sub btnSubmit_Click(sender As Object, e As System.EventArgs) Handles btnSubmit.Click
'validate captcha
If Not Page.IsValid Then
'recaptcha phrase entered was not correct
Return
End If
'validation successful
End Sub
Hope that helps, good luck!
Ok, I got most of that, but how do I reference the .dll from the .aspx file?
ReplyDeleteIf you are using Visual Studio you can right click on your web project in the Solution Explorer and choose "Add Reference..." and then browse to the Recaptcha.dll.
ReplyDeleteThen all you need to do is register the control on your .aspx page.
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
I'm building the site using DreamWeaver...if that means anything?
ReplyDeleteYou can probably just copy the Recaptcha.dll into your /bin folder then.
ReplyDeleteok, thanks Matt...much appreciated!!
ReplyDeleteNo problem!
ReplyDelete