1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / How to map subscribe form

How to map subscribe form

2 posts, 0 answered
  1. Milos Tadic
    Milos Tadic avatar
    32 posts
    Registered:
    05 Nov 2009
    05 Feb 2011
    Link to this post
    Hello,

    I need to style subscribe form, and to remove last name, etc....
    Here is my code:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubscriptionFormTemplate.ascx.cs" Inherits="UserControls_SubscriptionFormTemplate" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <asp:PlaceHolder runat="server" ID="emptyForm" Visible="false">
        <asp:Literal ID="Literal1" runat="server" Text="<p class='sf_emptyForm'>The Subscription Form has not been set yet!</p>"></asp:Literal>
    </asp:PlaceHolder>
    <asp:PlaceHolder ID="emailhldr" runat="server">
        <fieldset class="sf_newsletterSubscriptionForm" id="formFieldset" runat="server">
            <asp:Label ID="Label1" runat="server" Text="Email:" AssociatedControlID="sf1_email"></asp:Label>
            <asp:TextBox runat="server" ID="sf1_email" CssClass="sf_subscribeTxt" ValidationGroup="subscription"></asp:TextBox>
            <asp:RequiredFieldValidator ID="emailEmptyValidator1" runat="server"
                ValidationGroup="subscription" ControlToValidate="sf1_email" Display="Dynamic"
                EnableViewState="False" SetFocusOnError="True" CssClass="sf_emailValidation">
                <strong><asp:Literal ID="Literal2" runat="server" Text="Email cannot be empty!"></asp:Literal></strong>
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="emailREValidator1" runat="server"
                ControlToValidate="sf1_email" Display="Dynamic" EnableViewState="false" SetFocusOnError="true"
                ValidationExpression="\s*\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\s*" ValidationGroup="subscription" CssClass="sf_emailValidation">
                <strong><asp:Literal ID="literal3" runat="server" Text="Wrong email!"></asp:Literal></strong>
            </asp:RegularExpressionValidator>
     
            <asp:Button ID="subscribeButton" runat="server" Text="Subscribe" CssClass="sf_subscribeBtn" ValidationGroup="subscription" CausesValidation="true" />
     
        </fieldset>
    </asp:PlaceHolder>

    Also, I'm added layout path to administration--->setting-->controls-->viewMap
    And I got message:

    A required control was not found in the template for "~/controls/SubscriptionFormTemplate.ascx". The control must be assignable form type "System.Web.UI.WebControls.WebControl" and must have ID "selectListInstructionPanel"

    Any help would be useful.

    Thanks,
    Milos.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Feb 2011
    Link to this post
    Hello Milos Tadic,

    Can you please try using the default template, and then building on top of it.:
    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
     
     
    <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" ValidationGroup="subscribeForm" CssClass="sfErrorWrp" Display="Dynamic">
                    <strong class="sfError"><asp:Literal runat="server" ID="lEmailIsRequired" Text='<%$Resources:NewslettersResources, EmailIsRequired %>' /></strong>
                </asp:RequiredFieldValidator>
            </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>
            <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" />
            </li>
        </ol>
        <div class="sfnewsletterSubmitBtnWrp">
            <asp:Button ID="subscribeButton" runat="server" Text='<%$Resources:NewslettersResources, SubscribeToList %>' ValidationGroup="subscribeForm" CssClass="sfnewsletterSubmitBtn" />
        </div>
    </fieldset>
     
    <asp:Panel ID="selectListInstructionPanel" runat="server">
        <asp:Literal ID="pleaseSelectList" runat="server" Text='<%$Resources:NewslettersResources, ClickEditAndSelectList %>' />
    </asp:Panel>

    Your template is missing the above highlighted markup.

    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered