<%@ Page Language="vb" AutoEventWireup="false" 
    CodeBehind="frmChangePass.aspx.vb" 
    Inherits="CITAD.WEB.VB.frmChangePass" 
    Culture="auto" 
    meta:resourcekey="PageResource1" 
    UICulture="auto"
    Title="Đổi mật khẩu" %>

<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Đổi mật khẩu</title>
    <link href="../../css/citad.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="frmChangePass" runat="server">
    <div style="text-align:center; vertical-align:middle;padding-top:100px;">
        <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" EnableScriptGlobalization="True"
             EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="true" />

         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="main-tblContainer">
            <tr class="main-header">
                <td style="height: 19px">
                    <asp:Label ID="lblThayDoiMatKhau" runat="server" Text="Thay đổi mật khẩu" meta:resourcekey="lblThayDoiMatKhauResource1"></asp:Label>
                </td>
            </tr>
            <tr class="main-body">
            <td>
                <table style="margin-top:20px;margin-bottom:20px;">
                <tr>
                    <td style="width: 196px; padding-right: 10px;" align="right">
                        <asp:Label ID="lblUserID" runat="server" Text="Tên đăng nhập" meta:resourcekey="lblUserIDResource1"></asp:Label></td>
                    <td>
                        <asp:TextBox ID="txtUserID" runat="server" meta:resourcekey="TextBox1Resource1" Width="200px" CssClass="citad-txtReadonly" ReadOnly="True" MaxLength="16"></asp:TextBox></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td style="width: 196px; padding-right: 10px;" align="right">
                        <asp:Label ID="lblPasswords" runat="server" Text="Mật khẩu hiện tại" meta:resourcekey="lblPasswordsResource1"></asp:Label></td>
                    <td>
                        <asp:TextBox ID="txtPasswords" runat="server" meta:resourcekey="TextBox2Resource1" TextMode="Password" Width="200px" CssClass="citad-txt" MaxLength="30"></asp:TextBox></td>
                    <td align="left">
                        <asp:RequiredFieldValidator ID="rfvTextPass" runat="server" ControlToValidate="txtPasswords"
                            ErrorMessage="Mật khẩu không được để trống" ValidationGroup="ChangePass" Display="Dynamic" SetFocusOnError="True" meta:resourcekey="rfvTextPassResource1"></asp:RequiredFieldValidator></td>
                    <td align="left">
                        <asp:CustomValidator ID="ctvPassword" runat="server" ClientValidationFunction="fcnValidLength_Password"
                            ControlToValidate="txtPasswords" Display="Dynamic" ErrorMessage="Mật khẩu phải lớn hơn hoặc bằng 6 ký tự" ValidationGroup="ChangePass" meta:resourcekey="ctvPasswordResource1"></asp:CustomValidator></td>
                    <td></td>
                </tr>
                <tr>
                    <td style="width: 196px; padding-right: 10px;" align="right">
                        <asp:Label ID="lblNewPass" runat="server" Text="Mật khẩu mới" meta:resourcekey="lblNewPassResource1"></asp:Label></td>
                    <td>
                        <asp:TextBox ID="txtNewPass" runat="server" meta:resourcekey="TextBox3Resource1" TextMode="Password" Width="200px" CssClass="citad-txt" MaxLength="30"></asp:TextBox></td>
                    <td  align="left">
                        <asp:RequiredFieldValidator ID="rfvTextPassNew" runat="server" ErrorMessage="Mật khẩu mới không được để trống"
                               ValidationGroup="ChangePass" Display="Dynamic" SetFocusOnError="True" ControlToValidate="txtNewPass" meta:resourcekey="rfvTextPassNewResource1"></asp:RequiredFieldValidator></td>
                    <td align="left">
                        <asp:CustomValidator ID="ctvPassNew" runat="server" ClientValidationFunction="fcnValidLength_PassNew"
                             ControlToValidate="txtNewPass" Display="Dynamic" ErrorMessage="Mật khẩu mới phải lớn hơn hoặc bằng 6 ký tự"
                             ValidationGroup="ChangePass" meta:resourcekey="ctvPassNewResource1"></asp:CustomValidator></td>
                    <td></td>
                </tr>
                <tr>
                    <td style="width: 196px; padding-right: 10px;" align="right">
                        <asp:Label ID="lblRetypeNewPass" runat="server" Text="Nhập lại mật khẩu" meta:resourcekey="lblRetypeNewPassResource1"></asp:Label></td>
                    <td>
                        <asp:TextBox ID="txtRetypeNewPass" runat="server" meta:resourcekey="TextBox4Resource1" TextMode="Password" Width="200px" CssClass="citad-txt" MaxLength="30"></asp:TextBox></td>
                    <td  align="left">
                        <asp:RequiredFieldValidator ID="rfvTextPassNewReInput" runat="server" ErrorMessage="Phải nhập lại mật khẩu mới"
                            ValidationGroup="ChangePass" Display="Dynamic" Height="20px" SetFocusOnError="True" ControlToValidate="txtRetypeNewPass" meta:resourcekey="rfvTextPassNewReInputResource1"></asp:RequiredFieldValidator></td>
                    <td align="left">
                        <asp:CompareValidator ID="cpvPassNew" runat="server" ControlToCompare="txtNewPass"
                            ControlToValidate="txtRetypeNewPass" ErrorMessage="Mật khẩu nhập lại không đúng"
                            ValidationGroup="ChangePass" Display="Dynamic" SetFocusOnError="True" meta:resourcekey="cpvPassNewResource1"></asp:CompareValidator></td>
                    <td align="left">
                        <asp:CustomValidator ID="ctvPassNewReInput" runat="server" ClientValidationFunction="fcnValidLength_PassNewReInput"
                            ControlToValidate="txtRetypeNewPass" Display="Dynamic" ErrorMessage="Mật khẩu nhập lại phải lớn hơn hoặc bằng 6 ký tự"
                            ValidationGroup="ChangePass" meta:resourcekey="ctvPassNewReInputResource1"></asp:CustomValidator></td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnSave" ValidationGroup="ChangePass" runat="server" CssClass="citad-btn" Text="Ghi" Width="70px" meta:resourcekey="btnSaveResource1" />
                        <asp:Button ID="btnClose" runat="server" CssClass="citad-btn" Text="Đóng" Width="70px" meta:resourcekey="btnCloseResource1" /></td>
                </tr>
            </table>
            </td>
            </tr>
            </table>

                <uc1:MessageBox ID="MessageBox1" runat="server" />
            
        </ContentTemplate>
        </asp:UpdatePanel>
        &nbsp;
            
        </div>  
         <script language="javascript" type="text/javascript">
        function fcnValidLength_Password(source, clientside_arguments)
        {
            if(document.getElementById('<%=txtPasswords.ClientID %>').value.trim().length < 6)
            {
                clientside_arguments.IsValid = false;
                document.getElementById('<%=txtPasswords.ClientID %>').focus();
            }
        }
        function fcnValidLength_PassNew(source, clientside_arguments)
        {
            if(document.getElementById('<%=txtNewPass.ClientID %>').value.trim().length < 6)
            {
                clientside_arguments.IsValid = false;
                document.getElementById('<%=txtNewPass.ClientID %>').focus();
            }
        }
        function fcnValidLength_PassNewReInput(source, clientside_arguments)
        {
            if(document.getElementById('<%=txtRetypeNewPass.ClientID %>').value.trim().length < 6)
            {
                clientside_arguments.IsValid = false;
                document.getElementById('<%=txtRetypeNewPass.ClientID %>').focus();
            }
        }
    </script>     
    </form>
</body>
</html>