Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 707261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:15:28+00:00 2026-05-14T04:15:28+00:00

I am trying to use an old version of the Recaptcha Validator on a

  • 0

I am trying to use an old version of the Recaptcha Validator on a .net 1.1 project, which can be found here: http://recaptcha.googlecode.com/svn/trunk/recaptcha-plugins/dotnet-old/src/Recaptcha/

The code I have is very similar to an example that can be found at the above link:

<asp:TextBox ID="EmailAddress" runat="server"></asp:TextBox>
<recatpcha:RecaptchaValidator ID="RecaptchaValidator1" runat="server" Theme="Clean" PublicKey="xxxxxxxxxxxxxx" PrivateKey="xxxxxxxxxx" ControlToValidate="EmailAddress"></recatpcha:RecaptchaValidator>
<asp:Button ID="Button1" runat="server" Text="Button" CausesValidation="true" OnClick="Button1_Click" />

The behavior I would like is simple: on page load, the user is presented with a field to enter their email address, a captcha to complete, and a submit button. On submit, if no user is found in our database with that email address, or the captcha is answered incorrectly, a new captcha is displayed along with a appropriate error message. Otherwise, they will receive an email about how to reset their password.

The main issue is that the captcha does not display on page load. When I hit the submit button however, triggering Page.Validate(), the page is reloaded and the captcha is displayed.

Based on this, I figured I’d try a different approach and call Page.Validate() in the page load event to get the captcha to show up initially. This almost worked: the captcha showed up on first page load, but when an invalid email is submitted along with a correct captcha answer, the captcha disappears when the page is reloaded, but of course, the email cannot be sent.

How can I either force the captcha to be rendered when the page is hit initially, or, prevent the captcha from being submitted when an invalid email address is entered?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:15:29+00:00Added an answer on May 14, 2026 at 4:15 am

    Well, it’s not pretty, but I got it working.

    Since using the RecaptchaValidator tag didn’t work the way I wanted it to, I used the recaptcha AJAX API (http://recaptcha.net/apidocs/captcha/client.html) to embed the widget on the page thusly:

    $(document).ready(function() {
        Recaptcha.create("<public key>",
            "ReCaptcha", {
            theme: "clean",
            callback: Recaptcha.focus_response_field
        });
    });
    

    Then, since all the data need to validate with the recaptcha servers (challenge, publickey, etc. more info here: http://recaptcha.net/apidocs/captcha/) is in the POST, I instantiated a new RecaptchaValidator, set the remaining properties, and called the method to validate the user response.

    protected void Submit_Click(object sender, System.EventArgs e) 
    {
        RecaptchaValidator RecaptchaValidator1 = new RecaptchaValidator();
        RecaptchaValidator1.Page = this;
        RecaptchaValidator1.PrivateKey = "<private key>";
        RecaptchaValidator1.PublicKey = "<public key>";
    
        bool CaptchaPassed = RecaptchaValidator1.ValidateUserResponse();
    
        if (CaptchaPassed)
        {    
            //hide the captcha, do some stuff
        }       
    }
    

    Admittedly a bit hacky, but it got the job done.

    NOTE – I mentioned this in the question, but just to reiterate: the server side code for this uses the old, .NET 1.1 compatible recaptcha plug-in. The link to the code for the plug-in is in the question. I have embarrassingly low rep, and can’t use any more hyperlinks >.<

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From some old c++ code im trying to use a com dll, it works
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on
I'm trying to use svnmerge.py to merge some files. Under the hood it uses
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData .
I'm trying to use jQuery to format code blocks, specifically to add a <pre>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.