<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/AgentMaster.Master" AutoEventWireup="true"  EnableEventValidation="false"
    CodeBehind="ChangePassword.aspx.cs" Inherits="CasheeremitAgent.Account.ChangePassword" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
    <script type="text/javascript">  
        function swaRedirect(val, typ) {
            swal({
                title: "",
                text: val,
                type: typ,
                showConfirmButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "OK",
                closeOnConfirm: false
            }, function (isConfirm) {
                if (isConfirm) {
                    window.location.href = '<%=redurl %>';
                }
                else {
                }
            });
        }

        function Validate(validationgroupname) {
            
            if (Page_ClientValidate(validationgroupname)) {
                return 'success';
            }
        }

        function DisplayWaiting() {
            if (Validate('newpassword') == 'success') {
                $find('<%=ModalPopupExtender2.ClientID %>').show();
                setTimeout('document.images["imgLoad"].src = "../Styles/images/loading.gif"', 10);
            }
        }

        window.document.title = "Change Password";
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpLyremit" runat="server">
    <asp:ScriptManager ID="smgr" runat="server">
    </asp:ScriptManager>
    <div id="Div1" runat="server" class="col-md-12">
     <script type="text/javascript">
        
        </script>
        <div class="clearfix">
            &nbsp;</div>
      <div class="bluHD col-md-12" >
            CHANGE PASSWORD</div>
               <div  class="col-md-12 vinobox ">
        <div class="clearfix">
            &nbsp;</div>
        <div class="col-md-7">
            <div class="row mrgBot10">
                <div class=" col-md-3">
                    Old Password
                </div>
                <div class=" col-md-7">
                    <asp:TextBox ID="txtOTP" TabIndex="1" class="txtboxM" TextMode="Password" MaxLength="25"
                        runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rqfFirstName" runat="server" ErrorMessage="Please enter Old Password"
                        ControlToValidate="txtOTP" class="errMsg" ValidationGroup="newpassword" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="row mrgBot10">
                <div class=" col-md-3">
                    New Password
                </div>
                <div class=" col-md-7">
                    <input id="txtNewPassword" runat="server" type="password" class="txtboxM" maxlength="25"
                        tabindex="2" autocomplete="off" autocompletetype="Disabled" oncopy="return false;"
                        onpaste="return false;" oncut="return false;" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter New Password"
                        ControlToValidate="txtNewPassword" class="errMsg" ValidationGroup="newpassword"
                        Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtNewPassword"
                        Display="Dynamic" ValidationGroup="newpassword" CssClass="errMsg" ErrorMessage="Password must be minimum 5 characters."
                        Font-Size="X-Small" ValidationExpression="^[\s\S]{5,}$">
                    </asp:RegularExpressionValidator>
                    <asp:CompareValidator ID="cmpNewPassword" ValidationGroup="newpassword" runat="server"
                        ControlToValidate="txtNewPassword" class="errMsg" Display="Dynamic" ControlToCompare="txtOTP"
                        Operator="NotEqual" ErrorMessage="Old and New Password cannot be the same"></asp:CompareValidator>
                </div>
            </div>
            <div class="row mrgBot10">
                <div class=" col-md-3">
                    Confirm Password
                </div>
                <div class=" col-md-7">
                    <input id="txtConfPassword" runat="server" type="password" class="txtboxM" maxlength="25"
                        tabindex="3" autocomplete="off" autocompletetype="Disabled" oncopy="return false;"
                        onpaste="return false;" oncut="return false;" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please enter Confirm Password"
                        ControlToValidate="txtConfPassword" class="errMsg" ValidationGroup="newpassword"
                        Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtConfPassword"
                        Display="Dynamic" ValidationGroup="newpassword" CssClass="errMsg" ErrorMessage="Confirm Password must be minimum 5 characters."
                        Font-Size="X-Small" ValidationExpression="^[\s\S]{5,}$">
                    </asp:RegularExpressionValidator>
                    <asp:CompareValidator ID="CMPConfrmPassword" runat="server" ControlToCompare="txtNewPassword"
                        class="errMsg" Display="Dynamic" ValidationGroup="newpassword" ControlToValidate="txtConfPassword"
                        Operator="Equal" ErrorMessage="Password and Confirm Password should be the same"></asp:CompareValidator>
                </div>
            </div> </div>
             <div class="clearfix">
            &nbsp;</div>
            <div class="pull-right mrgBot10">
                <asp:Button ID="btnSubmit" TabIndex="4" runat="server" Text="Submit" class="btnB" CausesValidation = "true"
                    ValidationGroup="newpassword" OnClick="btnSubmit_click" />
                     <%--<asp:Button ID="Button2" TabIndex="5" runat="server" Text="Submit" class="btnB"
                    OnClick="btnSubmit2_click" />--%>
           
        </div>
    </div>
    <div id="dvProgressbar">
            <asp:Button runat="server" ID="Button1" Style="display: none" />
            <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none">
            <div class="modal1">
                <div class="center1">
                    <!-- Start -->
                    <img id="imgLoad" alt="Please wait....." src="../Styles/images/loading.gif" />
                    <!-- End -->
                    <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="Button1"
                        PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="false" />
                </div></div>
            </asp:Panel>
        </div></div>
</asp:Content>
