Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Google New ReCaptch API Example with Demo

Jan 20, 2015
Introduction

Here I will explain how to integrate Google new recaptcha in website to protect from spam attacks to your website. Google has introduced new recaptcha to validate protect site from spam and abuse. It uses advanced risk analysis engine to tell humans and bots apart
.

Description:
  
In previous articles I explained create shortest url using Google URL Shortner, Show user current location on Google map using GeoLocation Api, Show Google map with latitude and longitude in asp.net, Google currency converter api example in asp.net and many articles relating to Google API, Google MAPS, Google Charts,
jQuery and asp.net. Now I will explain how to add Google new recaptcha in website to protect from spam and abuse.

Before we start adding recatcha first we need to register our website in Google and you need to get secret key and site key for that check this link Google ReCaptcha

Login with your Google account and register your website in Google Recaptcha site and get site key & secret key like as shown below


Once you get Site key and Secrete key we need to add script file in header section like as shown below


<script src='https://www.google.com/recaptcha/api.js'></script>

Now add following div tag in your html code wherever you want to show captcha


<div class="g-recaptcha" data-sitekey="Your Site Key"></div>
If you want to check complete code we need to write code like as shown below

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google New Captcha Example in jQuery</title>
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<form id="form1">
<div class="g-recaptcha" data-sitekey="6LeZwQATAAAAAEwLSgOF3WEADeHrwgb_yua1h4qW"></div>
</form>
</body>
</html>
Demo

If we run above example we will get output like as shown below


Live Demo

To check live demo try to click on below captcha to validate it



If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

4 comments :

Unknown said...

nice one...bt how to connect it with .net code behind(c#)

Vignesh Vaidyanathan said...
This comment has been removed by the author.
Vignesh Vaidyanathan said...

Hi great example... Could you pls help with validation and connect it with .net code behind(c#)

ElMexBot said...

Well, this is what I call a completly incomplete example, don't waste people's time !!!

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.