Skip to content

Instantly share code, notes, and snippets.

@MoienTajik
Created February 17, 2018 13:01
Show Gist options
  • Save MoienTajik/f78de6c502cf295d2990b86cfcd693e8 to your computer and use it in GitHub Desktop.
Save MoienTajik/f78de6c502cf295d2990b86cfcd693e8 to your computer and use it in GitHub Desktop.
Using Google reCAPTCHA in ASP.NET MVC - Test Controller
public class TestController : Controller
{
[HttpGet]
public ActionResult Create()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
[ValidateGoogleCaptcha]
public ActionResult Create(string title)
{
// If we are here, Captcha is validated.
return View();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment