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:


Disabling EPiServer Scheduled Jobs programmatically in non production environment

Scenario: You just have copied the Production Database to your development server or to the testservers but you don’t want that some important jobs to be activated and running in the background on a non production environment.

Solution: Automatically disable EPiServer Scheduled Jobs programmatically in the initualization.

Following Māris Krivtežs blog post which describes greatly how to work with scheduled jobs.

My code:

How to determind production server or not:

Explanation: If you are using Config Transforms and any automatic deployment system, in my case Octopus, the “Environment” appsettings is set in the transform config. eg

A second possibility is to check the MachineName.

More about scheduled jobs: