Step 1:- Create a webpage

Step 2:- Download reCaptcha from given link and save it on your local system.

http://www.google.com/recaptcha/whyrecaptcha

Step 3:- Now click on Add Reference… and select recently downloaded reCaptcha.dll file.

Step 4:- Now write down the following code where you want to add Google reCaptcha.

<recaptcha:RecaptchaControl
 ID="recaptcha"
 runat="server"
 PublicKey="6LfqmdQSAAAAAHcyeGDCoLodLISt4d3LyC5ghIOS"
 PrivateKey="6LfqmdQSAAAAAFkZJAH9zivztO5VSwwJp_9XxcAt"
/>

Step 5:-To validate the reCaptcha, write down the following code in .cs file

 recaptcha.Validate();
if (Page.IsValid)
{
   // Write your code here when captcha successfully validated.
}
else
 {
    // Write your error code here when captcha not successfully validated.
  }

Now Google reCaptcha successfully added on your aspx page.

Leave Comment