1
votes

What is the best way to add captcha or something similar to an XForm in Episerver 7 MVC? When I used Webforms I could access the forms html before rendering by using the BeforeLoadingForms-Event and stuff like that...I've tried this in my MVC project but it seems that the function doesn't even exist?

One idea is to implement the captcha with Javascript but I want to be able to validate the captcha on the serverside as well...

This right here is exactly what I would like to do, but for MVC instead of Webforms... Using Recaptcha with EPiServer XForms

1
One ugly solution is to render the Recaptchahelper right after the XForm and then use Javascript to add it to the form. Ugly but it works... - JOSEFtw

1 Answers

0
votes

http://www.nuget.org/packages/RecaptchaNet supports ASP.NET MVC as well. Have you tried a recent version of it?

EDIT: To inject it you could create a display template called XForm and use it to render XForm properties.

If you want to go all the way you could retrieve the individual fragments of the XForm property data and render the entire form explicitly (injecting stuff where you want them).

You could make use of "Tags" to control whether or not your custom XForm rendering/display template should be used.