Recaptcha for MVC

Description

This package contain classes for apply Google Recapctcha for MVC. It is very simple and easy. More information about Google Recaptcha in https://developers.google.com/recaptcha/.

Nuget Package

install-package cco.recaptcha
Nuget Package for Recaptcha for MVC

How to Use

  1. Install Package
    install-package cco.recaptcha
  2. Include Keys in Web.config
    <add key="Recaptcha.Sitekey" value="YOUR_SITE_KEY" />
    <add key="Recaptcha.Secretkey" value="YOUR_SECRET_KEY" />
  3. Add Field in Model (optional)
    Example: public string RECAPTCHA {get; set;}
  4. Add Helper in View
    @Html.ValidateRecaptcha() or @Html.ValidateRecaptcha("RECAPTCHA") or @Html.ValidateRecaptchaFor(x => x.RECAPTCHA)
  5. Add Filter in Controller
    [ValidateRecaptcha()] or [ValidateRecaptcha("RECAPTCHA")]
  6. Verify Recaptcha
    - Javascript: grecaptcha.response
    - C# MVC: ModelState.IsValid

Development

Developed by Cesar Oliveira.
Help to improve by sending email to cesar@ccosolutions.com.br.