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

Add Google reCaptcha in Asp.Net Page


ASP.Net ASP.Net 
Ratings:
0 Comment(s)
 3224  View(s)
Rate this:

Add Google reCaptcha in Asp.Net Page

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.


Don't want to miss updates? Please click the below button!

Follow MindStick