Google Recaptcha and EPiServer.Forms

Forms 3.0.0, CMS 9.12, MVC

Last night I played with EPiServer Forms. And there is a sample pack to install as Eric Herlitz blogs about, for the moment containing a calender picker and Googles Recaptcha, real neet!

Install the EPiServer.Forms.Samples:

The RecaptchaElementBlock as it is, needs to have specified a sitekey and secret key (Register at to get your keys)

I found it unfortunate that the editors needed to fill in and remember the keys every time, so i found out a way to set them automaticly when the element block is created thanks to Alf Nilssons sample code on github. (by the way setting Allow Anonymous on Forms is a prefered default)

My code:


Like it? please up vote

2 thoughts on “Google Recaptcha and EPiServer.Forms”

  1. Thanks this works like charm. Have you tried to implement recaptcha version 3? pls share a walk through in that case

Leave a Reply

Your email address will not be published. Required fields are marked *