<%@ Page Language="C#" AutoEventWireup="true"  ClientIDMode="Static"  CodeBehind="Chagepwd.aspx.cs" Inherits="Worklog.chagepwd" %>
 

<!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 id="Head1" runat="server">
    <title>更改密码</title>
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
 
    <script src="Javascript/jquery3.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
     
    <link href="Style/patch.css" rel="stylesheet" />

</head>
<body >
    <form id="form1" runat="server">
 
           <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
         
 <div class="sitename">
	      <a class="navbar-brand sitename" href="default.aspx">更改密码</a>
    
        </div>
 </nav>
     
    
    <div style="  margin-top:150px;  text-align:center; width:600px">
    
      设置新密码: <asp:TextBox runat="server" ID="pwd"   CssClass="form-control" style=" width:200px; display:inline-block" 
          ValidationGroup="g2" TextMode=Password ></asp:TextBox> 


       <asp:Button runat="server" ID="btn_submit" 
            OnClientClick=" if(!isPwdOK()) { return false;} ;" 
           
           CssClass="btn" Text="确定" ValidationGroup="g2" onclick="btn_submit_Click"/>
     
        
        <asp:RequiredFieldValidator ControlToValidate="pwd" ValidationGroup="g2"  ID="RequiredFieldValidator3" runat="server" ErrorMessage="密码不能够为空" Display="Dynamic"></asp:RequiredFieldValidator>
    
    <br /><br />
        <div  style="color:gray; font-size:12px;">
               提示： 新密码至少8位且必须包含大写字母，小写字母，特殊符合和数字。
        </div>
 






        <script>


            function isPwdOK() {

                var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,40}');
                var pwd = $("#pwd").val();
              
                if (!pwdRegex.test(pwd)) {
                        alert("您的密码复杂度太低（密码中必须包含大小写字母、数字、特殊字符）");
                        return false;
                 }
                
                return true;
            }


        </script>




    </div>
    </form>
</body>
</html>
