Friday, September 23, 2011


I recently had a requirement to implement a CAPTCHA for one of our contact forms to minimize spam.

After much research and consideration I decided to use reCAPTCHA and the reCAPTCHA ASP.NET library.

Step 1 - Create a free account

Step 2 - Download the reCAPTCHA ASP.NET library

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.


  1. I can't find the aspnet library anywhere! It is not available in the google downloads!?! Any ideas / help?!?!

  2. Looks 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:

  3. yeah, but which one do I need for aspx ?

  4. I am using the current release, which is "reCAPTCHA .NET Library v1.0.5.0 Binary Only"

  5.'re going to be sorry now you replied back so quickly!! :)

    Can 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!!

  6. 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.

    Then 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

    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
    End If

    'validation successful
    End Sub

    Hope that helps, good luck!

  7. Ok, I got most of that, but how do I reference the .dll from the .aspx file?

  8. If 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.

    Then all you need to do is register the control on your .aspx page.


  9. I'm building the site using DreamWeaver...if that means anything?

  10. You can probably just copy the Recaptcha.dll into your /bin folder then.

  11. ok, thanks Matt...much appreciated!!