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

Forums / General Discussions / Spam Protector w/ Create User Wizard Control

Spam Protector w/ Create User Wizard Control

3 posts, 1 answered
  1. JWal
    JWal avatar
    2 posts
    Registered:
    26 Dec 2005
    18 Oct 2009
    Link to this post
    Is it possible to have the Spam Protector control work with the Create User Wizard Control or the Subscription Form Control with having to write any code? If so, how? I'm assuming that since it's in the Controls sidebar, it must be functional as is, from the Admin site - but I can't see how it gets wired up to the submit button to stop submitting the form data when the Captcha data entered isn't correct and therefore the page isn't valid???
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Oct 2009
    Link to this post
    Hi JWal,

    You can modify the control declaration of CreateUserWizard control as shown below:

    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" CreateUserButtonText="Sign up"  CreateUserButtonStyle-CssClass="test" >
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <ContentTemplate>
                    <fieldset>
                        <ul>
                            <li>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User name:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                    ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security question:</asp:Label>
                                <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                                    ErrorMessage="Security question is required." ToolTip="Security question is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security answer:</asp:Label>
                                <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                                    ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                             <li>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Email:</asp:Label>
                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                    ErrorMessage="E-mail is required." ToolTip="E-mail is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                        </ul>
                        <p><asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                            ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                        </p>
                        <p class="errorMsg"><asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal></p>
                      <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ValidationGroup="CreateUserWizard1"
                        ErrorMessage="The code you entered is not valid." Display="Dynamic">
                        </telerik:RadCaptcha>
                    </fieldset>
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
                    <h3>Signup</h3>
                    <p><strong>Your account has been successfully created.</strong></p>
                    <p><asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
                        Text="Continue" ValidationGroup="CreateUserWizard1" /></p>
              
                </ContentTemplate>
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>

    The control is located under Sitefinity/UserControls/Login folder of each Sitefinity's project. Note that the by default, the ID property of the CreateUserWizard control is used as the name of the validation group.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. JWal
    JWal avatar
    2 posts
    Registered:
    26 Dec 2005
    20 Oct 2009
    Link to this post
    Many thanks!
Register for webinar
3 posts, 1 answered