<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Cybersecurity.Register" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>CyberSecurity</title>
    <link href="Content/bootstrap.min.css" rel="stylesheet"/>
    <script src="Scripts/jquery-3.0.0.min.js"></script>
    <script src="Scripts/bootstrap.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <div >
    
        <h2>Register Form</h2>

        <div class="form-group">
            
            <div class="form-group row">
                <label for="txtFullName" class="col-sm-1 col-form-label">Full name:</label>
                <div class="col-sm-2">
                    <asp:TextBox ID="txtFullName" class="form-control" runat="server"></asp:TextBox>
                </div>                
                    
                <div class="col-sm-4">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic"
                        ControlToValidate="txtFullName"  ErrorMessage="Please Enter Your Fullname" 
                        ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regexNameValid" runat="server" ValidationExpression="^([A-Z][a-z]*?)\s+([A-Z][a-z]*)$"
                        ClientValidationFunction="changeColor" ForeColor="Red" Display="Dynamic"
                        ControlToValidate="txtFullName" ErrorMessage="Invalid Full Name Format"></asp:RegularExpressionValidator>
                </div>

            </div>


            <div class="form-group row">
                <label for="txtEmail" class="col-sm-1 col-form-label">Email:</label>
                <div class="col-sm-2">                
                    <asp:TextBox ID="txtEmail" class="form-control" runat="server"></asp:TextBox>
                </div>

                <div class="col-sm-4">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"  Display="Dynamic"
                        ControlToValidate="txtEmail"  ErrorMessage="Please Enter Your Email" 
                        ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ClientValidationFunction="changeColor" ForeColor="Red" Display="Dynamic"
                        ControlToValidate="txtEmail" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
                 </div>
            </div>


            <div class="form-group row">
                <label for="txtPassword" class="col-sm-1 col-form-label">Password:</label>
                <div class="col-sm-2">                
                    <asp:TextBox ID="txtPassword" class="form-control" TextMode="Password" runat="server"></asp:TextBox>
                </div>
                <div class="col-sm-4">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"  Display="Dynamic"
                        ControlToValidate="txtPassword"  ErrorMessage="Please Enter Your Password" 
                        ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="regexPasswordValid" runat="server" ValidationExpression="^.*(?=.{6,})(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[\W]).*$"
                        ClientValidationFunction="changeColor" ForeColor="Red" ControlToValidate="txtPassword" Display="Dynamic"
                        ErrorMessage="Include uppercase and lowercase letters, numeric and symbol characters, and be at least 6 in length"></asp:RegularExpressionValidator>
                    <ajaxToolkit:PasswordStrength ID="txtPassword_PasswordStrength" runat="server"   
                        BehaviorID="txtPassword_PasswordStrength" TargetControlID="txtPassword"  
                        MinimumLowerCaseCharacters="1" MinimumNumericCharacters="1"   
                        MinimumUpperCaseCharacters="1" MinimumSymbolCharacters ="1"
                        PreferredPasswordLength="10" 
                        TextStrengthDescriptions="Very Poor;Weak;Average;Strong;Excellent" 
                        RequiresUpperAndLowerCaseCharacters="true" 
                        CalculationWeightings="50;15;15;20"/> 
                 </div>
            </div>


            <div class="form-group row">
                <label for="txtConfirm" class="col-sm-1 col-form-label">Confirm Password:</label>
                <div class="col-sm-2">                
                    <asp:TextBox ID="txtConfirm" class="form-control" TextMode="Password" runat="server"></asp:TextBox>
                </div>
                <div class="col-sm-4">
                    <asp:CompareValidator id="Compare1" 
                        ControlToValidate="txtPassword" 
                        ControlToCompare="txtConfirm"
                        ErrorMessage="Password and Re-Password doesn't match"
                        Display="Dynamic"
                        ClientValidationFunction="changeColor" 
                        ForeColor="Red" 
                        runat="server"/>
                    <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator4" 
                        runat="server" 
                        Display="Dynamic"
                        ControlToValidate="txtConfirm"  
                        ErrorMessage="Please Confirm Your Password" 
                        ForeColor="Red"></asp:RequiredFieldValidator>
                    
                 </div>
            </div>

            

            
            <div class="form-group row">
                <div class="col-sm-1 text-center">
                    <asp:Button ID="Button1" class="btn btn-success"  runat="server" Text="Register" onclick="Button1_Click" />
                </div>
                <div class="col-sm-11">
                    <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red"></asp:Label>
                </div>
            </div>
        </div>
    
    </div>
    </form>
</body>
</html>
