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
- Install Package
install-package cco.recaptcha
- Include Keys in Web.config
<add key="Recaptcha.Sitekey" value="YOUR_SITE_KEY" />
<add key="Recaptcha.Secretkey" value="YOUR_SECRET_KEY" /> - Add Field in Model (optional)
Example:public string RECAPTCHA {get; set;}
- Add Helper in View
@Html.ValidateRecaptcha() or @Html.ValidateRecaptcha("RECAPTCHA") or @Html.ValidateRecaptchaFor(x => x.RECAPTCHA)
- Add Filter in Controller
[ValidateRecaptcha()] or [ValidateRecaptcha("RECAPTCHA")]
- 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.