CyberStore Documentation
CustomerAccountControl Class
Members 


Dovetail.Ecommerce.Controls Namespace : CustomerAccountControl Class

Step one of the registration process.

Remarks

The CustomerAccountControl displays the shopper's Account information including name, email, password, and phone number.

 

You can use the CustomerAccountControl to capture custom information from visitors when they register for a CyberStore Account.

To do so, create a Characteristic Family of the Account Type. Edit the CustomerAccountControl in your site's SitePages.config file. Include the Family name in the control's FamilyName property.

 

Property Usage

By changing the values of the control's properties in the SitePages.config file for your Site, you can enable or disable certain behaviors, set certain defaults, alter aspects of the display or otherwise cusomtize your site's implementaion of the control.

The following describes properties pertaining to key functional areas of the control that can be configured to suit your needs.

CSS Properties

The CharacteristicFieldCssClass gets or sets the characteristic field CSS class.

The CharacteristicFieldGroupCssClass gets or sets the characteristic field group CSS class.

The CharacteristicLabelCssClass gets or sets the characteristic label CSS class.

Family Properties

The DisplayFamilyName gets or sets a value indicating whether to display family name.

The FamilyName gets or sets the names of the family, or families or Account type Characteristic Families that are to be included as a series of additional fields to be included in the Account registration.

The HideFamiliesOnEmpty gets or sets a value indicating whether to hide Families when empty.

Key Properties

There are multiple key properties which can be customizes for this control. These key properties include the PrivateKeyPublicKeySecretKey, and the SiteKey property which sets the private key, public key, secret key, and the site key respectively.

Recaptcha Properties

The RecaptchaLanguage gets or sets the recaptcha language.

The RecaptchaProxyUrl gets or set the proxy url for recaptcha

The RecaptchaTheme gets or sets the recaptcha theme.

The RecaptchaUrl gets or set the url for recaptcha verification

The UseRecaptcha gets or sets a value indicating whether this Dovetail.Ecommerce.Controls.CatalogContactUsControl use recaptcha. 

Properties Inherited from the Base CyberStoreBaseControl

Properties specific to the CyberStoreBaseControl can be listed in the following categories:

Override Properties

When the IgnoreControl property is set to true, all processing of a control is skipped, and the control's Visible property is set to false ensuring that it is not rendered in the resulting CyberStore page.

Contextual Properties

Contextual properties define specific details about the current instance of the control based on context. Context can be set by any number of factors including the log in state of the Shopper, the Site being visited, or the properties that have been established for a control.

The AttributesBag property is used internal to control processing and is the collection of attributes, or properties, and their values based on how the control is configured. The attributes in this property are set by processing the SitePages.config file as well as any specific declared property values in any registered sub controls. It allows for the passing down of all properties to a control and any registered sub controls.

The ComConfigUserData and Site_ID properties are read-only values made available to all CyberStore controls to aid in processing and establishing context about the Site and Shopper.

Sub Controls

The table below lists and describes sub controls used by the default CustomerAccountControl.

Sub Control Description
CommonValidEmailControl Requests an email for the shopper and validates the input.
CommonRequiredPasswordControl Displays two password text boxes and performs all validation for these fields.
Control Markup

The following is the markup for this control.

Developer's Note:

To create a custom version of the control, copy all of the code below into a file of the same name and place it into your Site's control folder (e.g., ../YourSiteFolder/Control). The CyberStore page engine will then override the default markup with your customized version.

 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomerAccountControl.ascx.cs"
    Inherits="Dovetail.Ecommerce.Controls.CustomerAccountControl" %>
<@ Register TagPrefix="uc1" TagName="CommonValidEmailControl" Src="~/Control/CommonValidEmailControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CommonRequiredPasswordControl" Src="~/Control/CommonRequiredPasswordControl.ascx" >

<!--BEGIN ACCOUNT Registration Module-->
<link rel="stylesheet" href="../Ecommerce/js/intl-tel-input/css/intlTelInput.css">

<script src="Site/Shop/js/geographicData.js"></script>
<script src="js/intl-tel-input/intlTelInput.js"></script>
<script src="js/intl-tel-input/utils.js"></script>
<script src="js/intl-tel-input/intlTelInput-jquery.js"></script>

<script type="text/javascript">
    var fullMobileNumber = null;
    const iti = window;

    $(function () {
        if (document.querySelector("#mobilephoneTextBox")) {

            initiateCountryWidget();
        }
    });

    function initiateCountryWidget() {

        var countryList = _CountryStore._array.filter(getVisibleCountries => getVisibleCountries.UseCountry == true);

        var countryArray = [];

        countryList.forEach((key, index) => {
            countryArray.push(key["CountryCode"]);
        });

        var input = document.querySelector("#mobilephoneTextBox");

        iti.intlTelInput(input, {
            // allowDropdown: false,
            // autoHideDialCode: false,
            // autoPlaceholder: "off",
            // dropdownContainer: document.body,
            // excludeCountries: ["us"],
            // formatOnDisplay: false,
            // geoIpLookup: function(callback) {
            //   $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
            //     var countryCode = (resp && resp.country) ? resp.country : "";
            //     callback(countryCode);
            //   });
            // },
            //hiddenInput: "",
            // initialCountry: "auto",
            // localizedCountries: { 'de': 'Deutschland' },
            // nationalMode: false,
            //onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'],
            onlyCountries: countryArray,
            // placeholderNumberType: "MOBILE",
            // preferredCountries: ['cn', 'jp'],
            // separateDialCode: true,
            //utilsScript: locationString,
            utilsScript: "/js/intl-tel-input/utils.js"
        });
    }

    function enableSMSCheckBox_Click(sender, eventArgs) {

        if (sender.GetChecked()) {
            pnlMobileOptin.SetVisible(true);
        }
        else {
            pnlMobileOptin.SetVisible(false);
        }
    }


    function saveSMSNumber() {
        if ($('.iti__selected-flag')[0] && $('#mobilephoneTextBox')[0]) {
            var fullNum = $('.iti__selected-flag')[0].title + $('#mobilephoneTextBox')[0].value;

            var smsNumber = (fullNum.substring((fullNum.indexOf('+') + 1), fullNum.length));

            if ($('#mobilephoneTextBox')[0].value != "") {
                fullMobileNumber = smsNumber.replace(/\D/g, '');
                hfMobileNumber.Set("completeSMSNumber", smsNumber.replace(/\D/g, ''));
            }
            else {
                fullMobileNumber = "";
                hfMobileNumber.Set("completeSMSNumber", "");
            }

        }

    }


    function refreshSMSNumber() {

        if (fullMobileNumber != null) {
            $('#mobilephoneTextBox')[0].value = "+" + fullMobileNumber;
        }
    }
</script>
<!--<p class="BodyHeader">Account Registration 
    1 of 3</p>-->
    <style type="text/css">
    .control-group.row {
        margin-bottom: 0px;
    }
        #onfile .FormLabel {
             margin-top: 0px; 
        }
        #recaptchaDiv, .FormButtonMatte {
           /* margin-left: 120px;*/
        }
        #pnlMobileOptin {
            padding: 0px;
            background: #f5f1f1;
        }
        #lblConfirmed {
            font-weight:bold;
        }
        #lblEnterCode {
            font-weight:bold;
            display:inline-block;

        }
        .iti__flag {background-image: url("js/intl-tel-input/img/flags.png");}

        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
          .iti__flag {background-image: url("js/intl-tel-input/img/flags@2x.png");}
        }
        table#confirmationCodeTextBox {
            float: none;
        }
        #sendCodeButton,  #confirmCodeButton {
            margin: 5px;
            padding: 3px;
        }
        input#cancelButton {
            padding: 8px;
        }
    </style>

<p>Please complete the following information to establish your website account.</p><br>
<asp:ValidationSummary ID="registrationValidationSummary" ForeColor=" " HeaderText="Important Message:"
    CssClass="ValidationMessage" runat="server"></asp:ValidationSummary>
<asp:Label ID="outputLabel" CssClass="InfoMessage" runat="server"></asp:Label>
<p>
</p>
<dx:ASPxPanel ID="onfile" CssClass="container" ClientIDMode="Static" runat="server" ClientInstanceName="onfile" DefaultButton="registrationsubmitButton">
    <PanelCollection>
        <dx:PanelContent>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    <asp:Label ID="lbl_firstname" runat="server">First Name:</asp:Label>
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <asp:TextBox ID="firstnameTextBox" TabIndex="1" CssClass="FormField" runat="server"
                        Width="222px" MaxLength="10"></asp:TextBox><asp:RequiredFieldValidator ID="firstnameRequiredFieldValidator"
                            CssClass="RequiredFieldLabel" runat="server" Width="10px" Display="None" ControlToValidate="firstnameTextBox"
                            ErrorMessage="You must enter a First Name">*</asp:RequiredFieldValidator><span class="RequiredFieldLabel">*</span>
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    <asp:Label ID="lbl_lastname" runat="server">Last Name:</asp:Label>
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <asp:TextBox ID="lastnameTextBox" TabIndex="2" CssClass="FormField" runat="server"
                        Width="222px" MaxLength="19"></asp:TextBox><asp:RequiredFieldValidator ID="lastnameRequiredFieldValidator"
                            CssClass="RequiredFieldLabel" runat="server" Display="None" ControlToValidate="lastnameTextBox"
                            ErrorMessage="You must enter a Last Name">*</asp:RequiredFieldValidator><span class="RequiredFieldLabel">*</span>
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    Email Address:
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <uc1:CommonValidEmailControl ID="Email1" tabIndex="3" runat="server"></uc1:CommonValidEmailControl>
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    Password:
                </label>
                <div class="controls col-xs-12 col-sm-5 requestFieldText">
                    <asp:TextBox ID="passwordTextBox" TabIndex="4" CssClass="FormField" runat="server"
                        Width="222px" TextMode="Password">
                    </asp:TextBox>
                    <asp:RequiredFieldValidator ID="passwordRequiredFieldValidator" CssClass="RequiredFieldLabel"
                        runat="server" Display="None" ControlToValidate="passwordTextBox" ErrorMessage="You must enter a password">*</asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="pwCustomValidator" runat="server" Display="None" ControlToValidate="passwordTextBox"
                        ErrorMessage="The password must be a minimum of 5 characters." OnServerValidate="pwCustomValidate"
                        EnableClientScript="false">*</asp:CustomValidator>
                    <span class="RequiredFieldLabel">*</span> (5 character minimum)
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    Confirm Password:
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <asp:TextBox ID="passwordconfirmTextBox" TabIndex="5" CssClass="FormField" runat="server"
                        Width="222px" TextMode="Password">
                    </asp:TextBox>
                    <asp:RequiredFieldValidator ID="confirmpasswordRequiredfieldvalidator" CssClass="RequiredFieldLabel"
                        runat="server" Display="None" ControlToValidate="passwordconfirmTextBox" ErrorMessage="You must confirm your password."
                        EnableClientScript="false">*</asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="passwordCompareValidator" runat="server" Display="None"
                        ControlToValidate="passwordconfirmTextBox" ErrorMessage="Confirm Password does not match password."
                        ControlToCompare="passwordTextBox">*</asp:CompareValidator>
                    <span class="RequiredFieldLabel">*</span>
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    Primary Phone:
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <asp:TextBox ID="primaryphoneTextBox" TabIndex="7" CssClass="FormField" runat="server"
                        Width="155px"></asp:TextBox><span class="FormLabel">&nbsp;Ext.</span>
                    <asp:TextBox ID="primaryphoneextTextBox" TabIndex="8" CssClass="FormField" runat="server"
                        Width="30px"></asp:TextBox>
                </div>
            </div>
            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                    Alternate Phone:
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <asp:TextBox ID="alternatephoneTextBox" TabIndex="9" CssClass="FormField" runat="server"
                        Width="155px"></asp:TextBox><span class="FormLabel">&nbsp;Ext.</span>
                    <asp:TextBox ID="alternatephoneextTextBox" TabIndex="10" CssClass="FormField"
                        runat="server" Width="30px"></asp:TextBox>
                </div>
            </div>



            
            <dx:ASPxCallBackPanel ID="cbPanel_MFASection" runat="server" ClientIDMode="Static" ClientInstanceName="cbPanel_MFASection" 
                OnCallback="cbPanel_MFASection_Button_Click">
                <ClientSideEvents EndCallback="function(s,e){
                    refreshSMSNumber();
                    initiateCountryWidget();
                 }" />
                <PanelCollection>
                    <dx:PanelContent runat="server">
                        <dx:ASPxPanel runat="server" ClientIDMode="Static" ClientInstanceName="pnlMFASection" ID="pnlMFASection" CssClass="col-xs-12">
                            <PanelCollection>
                                <dx:PanelContent>
                                    <div class="control-group row col-xs-12"  style="padding: 0 10px;">
                                        <div class="control-group row col-xs-12">
                                            <label class="FormLabel col-xs-12 col-sm-3" style="margin-top: 0;">
                                                Multi-Factor Authentication:
                                            </label>
                                            <div class="controls col-xs-12 col-sm-5">                    
                                                <label class="col-xs-12" style="padding-left: 0;">                             
                                                    <dx:ASPxCheckBox ID="enableSMSCheckBox" ClientInstanceName="enableSMSCheckBox" runat="server" AutoPostBack="false" Checked="false" Text="Use SMS Text Messaging">
                                                        <ClientSideEvents CheckedChanged="function(s,e){enableSMSCheckBox_Click(s,e);}" />
                                                    </dx:ASPxCheckBox>
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <dx:ASPxHiddenField ID="hfMobileNumber" ClientInstanceName="hfMobileNumber" runat="server" />

                                    <dx:ASPxPanel runat="server" ClientIDMode="Static" ClientInstanceName="pnlMobileOptin" ClientVisible="false" ID="pnlMobileOptin" CssClass="row col-xs-12">
                                        <PanelCollection>
                                            <dx:PanelContent>
                                                <div class="control-group row col-xs-12">
                                                    <label class="FormLabel col-xs-12 col-sm-3">
                                                        Mobile Phone:
                                                    </label>
                                                    <div class="controls col-xs-12 col-sm-5" style="vertical-align:middle;padding-left: 25px;">
                                                        <asp:TextBox ID="mobilephoneTextBox" TabIndex="12" CssClass="FormField" runat="server" Width="155px" AutoComplete="off"></asp:TextBox>

                                                        <%--<asp:RequiredFieldValidator ID="mobileNumberRequiredFieldValidator"  
                                                            CssClass="RequiredFieldLabel" runat="server" Display="None" ControlToValidate="mobilephoneTextBox" 
                                                            ErrorMessage="You must enter a Mobile Number">*</asp:RequiredFieldValidator><span class="RequiredFieldLabel">*</span>--%>
                                
                                                        <dx:ASPxLabel ID="lblConfirmed" runat="server" ClientIDMode="Static" ClientInstanceName="lblConfirmed"
                                                            Visible="false" Text="CONFIRMED"></dx:ASPxLabel>
                                
                                                        <dx:ASPxButton ID="sendCodeButton" ClientIDMode="Static" ClientInstanceName="sendCodeButton" AutoPostBack="false" 
                                                            Visible="false" runat="server" Text="Send Confirmation Code">
                                                            <ClientSideEvents Click="function(s,e){
                                                                e.processOnServer=false;
                                                                saveSMSNumber();
                                                                cbPanel_MFASection.PerformCallback('sendCodeButton');
                                                                }" />
                                                        </dx:ASPxButton>                                                                

                                                        <dx:ASPxButton ID="confirmCodeButton" ClientIDMode="Static" ClientInstanceName="confirmCodeButton"
                                                            AutoPostBack="false" Visible="false" runat="server" Text="Confirm">
                                                            <ClientSideEvents Click="function(s,e){
                                                                e.processOnServer=false;
                                                                saveSMSNumber();
                                                                cbPanel_MFASection.PerformCallback('confirmCodeButton,' + ASPxClientControl.GetControlCollection().GetByName('confirmationCodeTextBox').GetText());
                                                                }" />
                                                        </dx:ASPxButton>  

                                                        <div class="control-group row col-xs-12" style="padding: 0 10px; vertical-align:middle;">
                                                            <div class="controls col-xs-12 col-sm-3">
                                                                <dx:ASPxTextBox ID="confirmationCodeTextBox" ClientIDMode="Static" ClientInstanceName="confirmationCodeTextBox"
                                                                    CssClass="FormField confirmationCodeTextBox" Visible="false" runat="server" Width="100px" placeholder="XXXXXX"></dx:ASPxTextBox>

                                                            </div>
                                                            <label class="FormLabel col-xs-12 col-sm-5" style="margin-top:10px;">
                                                                <dx:ASPxLabel ID="lblEnterCode" runat="server" ClientIDMode="Static" ClientInstanceName="lblEnterCode"
                                                                    Visible="false" Text="Enter code here"></dx:ASPxLabel>
                                                            </label>
                                                        </div>              

                                                    </div>
                                                </div>
                                                
                                                <div class="controls col-xs-12 col-sm-5 col-sm-offset-3 offset-sm-3" id="mobileVerificationDiv" runat="server" />
                                                <asp:CustomValidator ID="mobileNumberValidator" runat="server" Display="None"
                                                    ErrorMessage="You have opted in to recieve SMS Text Messages for Multi-Factor Authentication. Please enter a Mobile Phone number to submit the form."
                                                    EnableClientScript="false" />

                                                <div class="control-group row col-xs-12" style="padding: 0 10px;">
                                                    <label class="FormLabel col-xs-12 col-sm-3">
                                                    </label>
                                                    <div class="controls col-xs-12 col-sm-5">
                                                        <label class="col-xs-12" style="padding-left: 10px;">
                                                            <p style="font-weight: 500;">By providing your mobile number, you consent to receive SMS text messages from us. Third-party provider charges may apply. Consult your mobile provider agreement.</p>
                                                        </label>
                                                    </div>
                                                </div>
                                            </dx:PanelContent>
                                        </PanelCollection>
                                    </dx:ASPxPanel>
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </dx:PanelContent>
                </PanelCollection>
            </dx:ASPxCallBackPanel>




            <div class="control-group row col-xs-12">
                <label class="FormLabel col-xs-12 col-sm-3">
                </label>
                <div class="controls col-xs-12 col-sm-5">
                    <dx:ASPxCheckBox ID="chkMailchimpStatus" runat="server" Visible="false" />
                </div>
            </div>

            <asp:PlaceHolder ID="plcCharacterisitcs" runat="server"></asp:PlaceHolder>

            <div class="control-group row col-xs-12">
                <div class="controls col-xs-12 col-sm-5 col-sm-offset-3 offset-sm-3" id="recaptchaDiv" runat="server" />
                <asp:CustomValidator ID="recaptchaValidator" runat="server" Display="None"
                    ErrorMessage="You must pass the reCAPTCHA to submit the form."
                    EnableClientScript="false" />
                <div class="controls col-xs-12 col-sm-5 col-sm-offset-3 offset-sm-3 FormButtonMatte">
                    <dx:ASPxButton ID="registrationsubmitButton" TabIndex="11" CssClass="btn FormButtonAlternate"
                        runat="server" Text="Continue" OnClick="registrationsubmitButton_Click">
                        <ClientSideEvents Click="function(s,e){saveSMSNumber();}" />
                    </dx:ASPxButton>
                    <asp:Button CausesValidation="false" ID="cancelButton" CssClass="btn FormButtonAlternate" runat="server" Text="Cancel"
                        OnClick="cancelButton_Click"></asp:Button>
                </div>
            </div>

        </dx:PanelContent>
    </PanelCollection>
</dx:ASPxPanel>

Inheritance Hierarchy

System.Object
   System.Web.UI.Control
      System.Web.UI.TemplateControl
         System.Web.UI.UserControl
            Dovetail.Ecommerce.ControlBases.CyberStoreBaseControl
               Dovetail.Ecommerce.Controls.CustomerAccountControl

See Also

Reference

CustomerAccountControl Members
Dovetail.Ecommerce.Controls Namespace