最基础的密码框验证

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>

    <form runat="server">

    <asp:textbox runat="server" ID="PassWord1" textmode=Password />  
    <asp:textbox runat="server" ID="PassWord2" textmode=Password />  

  <!-- 没有内容时显示错误提示 -->
    <asp:requiredfieldvalidator ID="Requiredfieldvalidator1" ControlToValidate="PassWord1" Display="Dynamic" ForeColor="#ff0000" Font-name="宋体" Font-Size="9pt" Text="请填写" runat="server" />

  <!-- 两个控件内容不一致时,显示错误提示 -->
    <asp:comparevalidator ID="Comparevalidator1" ControlToValidate="PassWord2" ControlToCompare="PassWord1" operator="equal" Display="Dynamic" ForeColor="#ff0000" Font-name="宋体" Font-Size="9pt" Text="确认失败" runat="server" />

    </form>

</body>
</html>