blog

Home / DeveloperSection / Blogs / Add Google reCaptcha in Asp.Net Page

Add Google reCaptcha in Asp.Net Page

AVADHESH PATEL5327 27-Jul-2012

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.


Updated 18-Sep-2014
Avadhesh Kumar Patel District Project Manager - Aligarh 14 months work experience in Panchayati Raj Department Sector as District Project Manager & 12 months work experience in IT Sector as Software Engineer. :-)

Leave Comment

Comments

Liked By