More in this section
Forums / Developing with Sitefinity / how to override subscribe widget functionality?

how to override subscribe widget functionality?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. rupali
    rupali avatar
    14 posts
    08 Mar 2016
    09 Mar 2016
    Link to this post

    I am using  Sitefinity 7.1.5213.0 version.I have added radcaptcha in subscribe widget of sitefinity.captcha works fine but even after captcha not valid ,the user get subscribed .And user gets added into mailing list .But i dont want to add email into mailing list when captcha not valid.I have added captcha validation on subscribe button click event. Below is my code.

    Plz help me in it.

    ascx markup:


    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubscribeFormCustomTemplate.ascx.cs" Inherits="SitefinityWebApp.UserControls.SubscribeFormCustomTemplate" %>
    <%--<%@ Control Language="C#" %>--%>
    <%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>

    <%-- <script src="" async defer></script>--%>
    <asp:Panel ID="errorsPanel" runat="server" CssClass="sfErrorSummary" Visible="false" />
    <fieldset id="formFieldset" runat="server" class="sfnewsletterForm sfSubscribe">
        <sitefinity:SitefinityLabel ID="widgetTitle" runat="server" WrapperTagName="h2" HideIfNoText="true" CssClass="sfnewsletterTitle" />
        <sitefinity:SitefinityLabel ID="widgetDescription" runat="server" WrapperTagName="p" HideIfNoText="true" CssClass="sfnewsletterDescription" />
        <sitefinity:Message ID="messageControl" runat="server" FadeDuration="3000" />
        <ol class="sfnewsletterFieldsList">
            <li class="sfnewsletterField">
                <asp:Label ID="emailAddressLabel" runat="server" Text='<%$Resources:NewslettersResources, EmailAddress %>' AssociatedControlID="emailAddress" CssClass="sfTxtLbl" />
                <asp:TextBox ID="emailAddress" runat="server" CssClass="sfTxt" />
                <asp:RequiredFieldValidator ID="emailValidator" runat="server" ControlToValidate="emailAddress" CssClass="sfErrorWrp" Display="Dynamic">
                    <strong class="sfError">
                        <asp:Literal runat="server" ID="lEmailIsRequired" Text='<%$Resources:NewslettersResources, EmailIsRequired %>' /></strong>
                    ErrorMessage="<%$ Resources:ErrorMessages, EmailAddressViolationMessage %>">
                    <strong class="sfError">
                        <asp:Literal ID="lEmailNotValid" runat="server" Text="<%$ Resources:ErrorMessages, EmailAddressViolationMessage %>" /></strong>
                </asp:RegularExpressionValidator></li><li class="sfnewsletterField">
                <asp:Label ID="firstNameLabel" runat="server" Text='<%$Resources:NewslettersResources, FirstNamePublicForm %>' AssociatedControlID="firstName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="firstName" runat="server" CssClass="sfTxt" />
            <li class="sfnewsletterField">
                <asp:Label ID="lastNameLabel" runat="server" Text='<%$Resources:NewslettersResources, LastNamePublicForm %>' AssociatedControlID="lastName" CssClass="sfTxtLbl" />
                <asp:TextBox ID="lastName" runat="server" CssClass="sfTxt" />
            <%--<br /> 
            <div class="g-recaptcha" data-sitekey="6LfNuhgTAAAAAHoVGH51Vs3iYNRb2Dual2_8Tv26"></div>
            <asp:Label ID="lblMsg" runat="server" Visible="false" CssClass="sfTxt" />
        <div class="sfnewsletterSubmitBtnWrp">
            <asp:Button ID="subscribeButton" 
                runat="server" Text='<%$Resources:NewslettersResources, SubscribeToList %>' 
                CssClass="sfnewsletterSubmitBtn" onclick="subscribeButton_Click" /></div>
     <asp:Panel ID="selectListInstructionPanel" runat="server">
        <asp:Literal ID="pleaseSelectList" runat="server" Text='<%$Resources:NewslettersResources, ClickEditAndSelectList %>' />


  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    17 Aug 2017
    11 Mar 2016
    Link to this post
    Hi Rupali,

    Please check the below KB article for more details about how to extend the subscribe widget and add a captcha control

    You may also check the below forum post where I have added some additional details on how to implement it and also have attached a video demonstrating the exact steps;

    Sabrie Nedzhip
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  3. rupali
    rupali avatar
    14 posts
    08 Mar 2016
    14 Mar 2016 in reply to Sabrie Nedzhip
    Link to this post
    Thank You for your reply...I will try this solution.
3 posts, 0 answered