MvcReCaptcha v1.0.0

Rating:        Based on 2 ratings
Reviewed:  2 reviews
Downloads: 7567
Released: Jul 31, 2009
Updated: Jul 31, 2009 by ericgarza
Dev status: Stable Help Icon

Recommended Download

Source Code MvcReCaptchaSource.zip
source code, 17K, uploaded Jul 31, 2009 - 6386 downloads

Other Available Downloads

Application MvcReCaptchaRelease.zip
application, 10K, uploaded Jul 31, 2009 - 1181 downloads

Release Notes

Using ReCaptcha with Asp.Net MVC

It is now extremely easy to setup ReCaptcha on your Asp.Net MVC Website.

Signup for reCaptcha, http://recaptcha.net/whyrecaptcha.html

How to Use:

Step 1: Add your Public and Private key to your web.config file in appsettings section

<appSettings>
	<add key="ReCaptchaPrivateKey" value=" -- PRIVATE_KEY -- " />
	<add key="ReCaptchaPublicKey" value=" -- PUBLIC KEY -- " />
</appSettings>			

Step 2: Add new namespace to your web.config

<namespaces>
	<add namespace="MvcReCaptcha.Helpers"/>
</namespaces>

Step 3: Implement the logic in your view to actually render the Captcha control

<%= Html.GenerateCaptcha() %>

Step 4: Implement the Controller Action that will handle the form submission and Captcha validation

[CaptchaValidator]
[AcceptVerbs( HttpVerbs.Post )]
public ActionResult CreateComment( Int32 id, bool captchaValid )
{
	if (!captchaValid)
	{
		ModelState.AddModelError("_FORM", "You did not type the verification word correctly. Please try again.");
	}
	else
	{
		// If we got this far, something failed, redisplay form
		return View();
	}
}

Reviews for this release

     
This project is now obsolete. It looks to be directly integrated with Google's ReCaptcha library (same code). Just FYI, get latest from Google COde and you have this.
by eduncan911 on May 19, 2011 at 3:16 AM
     
The documentation should include a mention of Html.ValidationSummary, but other than that, great control. Can it be styled?
by pettijohn on Mar 27, 2010 at 4:49 AM