Captcha in Subscribe Widget
Hi,
We are working on Sitefinity version 7.1.
We need to add captcha in the subscribe widget. Can any one help on this ?
We tried the link below, but it does not work, the ".cs" page where the "AddSubscriber()" method is overridden is never called, we have followed exact instructions.
www.sitefinity.com/.../extend-subscribe-form-widget-with-server-side-captcha-validation
We can see the captcha, but the validation never fires.
Can anyone help on this to add captcha / recaptcha on the subscribe widget, any working reference or code ?
This is very very urgent.
Thanks.
Hello Rakesh,
I have just tested this on my side on a Sitefinity 7.1 project following the exact steps from the KB article and the captcha is validated properly.
Please download the archive from the KB article and extract it in the root folder of your project solution. The archive contains the SubscribeFormCustom.cs file which is extending the custom Subscribe form widget. The SubscribeFormCustomTemplate.ascx file in the archive is the custom template that the custom subscribe form widget will use where I have added the captcha control in the markup.
Then please build the project and register the custom subscribe form (SubscribeFormCustom.cs) in the Toolboxes using Thunder as described in this article: http://docs.sitefinity.com/thunder-register-a-widget
Restart the application in order for the changes to take effect and you will be able to drop the custom Subscribe form on a page and test the behavior with the captcha.
I am also sending attached a video for your reference demonstrating the results on my side. As you can see from the video the overridden AddSubscriber() method is called and if the captcha is not valid the base AddSubscriber() method is not executed and the subscriber is not added to the mailing list.
Regards,
Sabrie Nedzhip
Telerik
Thanks very much for the reply.
We don't have Ditefinity thunder on our local development enviroment, how do we register without using Sitefinity thunder ?
Hello Rakesh,
Please check the below article describing the different approaches to register custom widgets in the Sitefinity toolbox:
http://docs.sitefinity.com/register-a-new-widget-in-sitefinity-toolbox
You can register the widget directly in the backend following the steps described here: http://docs.sitefinity.com/register-a-new-widget-in-the-backend
In the Control CLR type or virtual path field enter the fully qualified type name of the widget.
For example: SitefinityWebApp.MyFolder.MyCustomWidget, SitefinityWebApp
If the SubscribeFormCustom.cs (which inherits from SubscribeForm) file is created in the root project folder in the Control CLR type or virtual path field enter: SitefinityWebApp.SubscribeFormCustom, SitefinityWebApp
Regards,
Sabrie Nedzhip
Telerik
Hello Rupali,
Can you please make sure you build the project in Visual Studio? Then Sitefinity should be able to successfully resolve the custom control you try to register.
Regards,
Sabrie Nedzhip
Telerik
Thank you for reply. Captcha working now.