Custom Subscription Form Webpart

Vic Carter asked on June 2, 2016 19:48

In attempting to create a custom layout for this webpart, I receive the following error:

Message: Unknown server tag 'cms:SecurityCode'.

This appears to be an issue with this webpart, it has not affected any other webparts with custom layouts.

Has anyone experienced this before. This occurs with any custom layout(even when the default code is used).

Is there a name conflict or something of that nature?

Thank You

Recent Answers


Joshua Adams answered on June 2, 2016 20:38

Does the normal layout contain a register directive with that control, or are you adding that control in your custom layout? Usually that means that its not registered as a control in your layout.

Something like this:

<%@ Register tagprefix="tagprefix" tagname="tagname" src="pathname" %> OR
<%@ Register tagprefix="tagprefix" namespace="namespace" assembly="assembly" %>
0 votesVote for this answer Mark as a Correct answer

Vic Carter answered on June 2, 2016 20:54 (last edited on June 2, 2016 20:55)

Yes it is registering the Captcha security controls. Here is the default layout for the CustomSubscriptionForm webpart. As long as I leave this as the default it works fine. If I create a new layout and make no modifications I get an error. On the page and in the event log.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="~/CMSWebParts/Newsletters/CustomSubscriptionForm.ascx.cs" Inherits="CMSWebParts_Newsletters_CustomSubscriptionForm" %>
    <%@ Register Src="~/CMSFormControls/Captcha/SecurityCode.ascx" TagName="SecurityCode" TagPrefix="cms" %>
    <asp:Label ID="lblError" runat="server" EnableViewState="false" Visible="false" />
    <asp:Label ID="lblInfo" runat="server" EnableViewState="false" Visible="false" />
    <asp:Panel ID="pnlSubscription" runat="server" DefaultButton="btnSubmit" CssClass="Subscription">
        <cms:DataForm ID="formElem" runat="server" />
        <asp:PlaceHolder runat="server" ID="plcNwsList">
            <div class="NewsletterList">
                <asp:CheckBoxList runat="server" ID="chklNewsletters" CssClass="NewsletterList" />
            </div>
        </asp:PlaceHolder>
        <asp:PlaceHolder runat="server" ID="plcCaptcha">
            <div class="CaptchaLabel">
                <cms:LocalizedLabel ID="lblCaptcha" runat="server" EnableViewState="false" />
            </div>
            <div class="Captcha">
                <cms:SecurityCode ID="scCaptcha" GenerateNumberEveryTime="false" runat="server" />
            </div>
        </asp:PlaceHolder>
        <asp:PlaceHolder ID="pnlButtonSubmit" runat="server">
            <cms:LocalizedButton ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" CssClass="SubscriptionButton"
                EnableViewState="false" />
        </asp:PlaceHolder>
        <asp:PlaceHolder ID="pnlImageSubmit" runat="server">
            <asp:ImageButton ID="btnImageSubmit" runat="server" OnClick="btnSubmit_Click" EnableViewState="false" />
        </asp:PlaceHolder>
    </asp:Panel>
0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on June 2, 2016 20:55

Whats different between yours and the default? Maybe start there and see what you may be missing or needing to add.

0 votesVote for this answer Mark as a Correct answer

Vic Carter answered on June 2, 2016 20:57

Even if I use the default with no adjustments it breaks. I always start with the base layout and make my modifications to that.

Thank you for taking the time to assist.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on June 2, 2016 21:04

What version and hotfix are you in? Did you recently upgrade?

0 votesVote for this answer Mark as a Correct answer

Vic Carter answered on June 2, 2016 21:17 (last edited on June 2, 2016 21:18)

v8.2.47

Our agency does not have control over the clients update/upgrade process, but I am not aware of any recent changes to their environment. I also receive the error when I attempt to create a custom layout for the standard newsletter subscription webpart.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.