asp.net 服务器端的验证控件——密码修改验证

只是在页面进行简单的验证。 

<table >
         <tr>
         <td>
          用户名称:<asp:TextBox ID="UserName" runat="server" Width ="150"></asp:TextBox>
         <asp:RequiredFieldValidator ID="reqiredUsername" runat="server" ErrorMessage="用户名称不能为空。" ControlToValidate="UserName" Display ="Dynamic" ></asp:RequiredFieldValidator>
         <asp:RangeValidator ID="renge" runat ="server" ControlToValidate ="UserName" ErrorMessage ="必须是小写字母," MaximumValue ="z" MinimumValue ="a" Font-Bold ="true" ></asp:RangeValidator>
         </td>
         </tr>
         <tr>
         <td>
          原始密码:<asp:TextBox ID="Password"  runat ="server" Width ="150"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequPassword" runat ="server" ErrorMessage ="原始密码不能为空。" ControlToValidate ="Password" Display ="Dynamic" ></asp:RequiredFieldValidator>
         </td>
         </tr>
         <tr>
         <td>
          新 密 码:<asp:TextBox ID="NewPassword"  runat ="server" Width ="150"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredNewPassword" runat ="server" ErrorMessage ="新密码不能为空。" ControlToValidate ="NewPassword" Display ="Dynamic" ></asp:RequiredFieldValidator>
          </td>
         </tr>
         <tr>
          <td>
          确认密码:<asp:TextBox ID="SurePassword" runat="server" Width ="150"> </asp:TextBox>
          <asp:CompareValidator ID="comparePassword" runat ="server" ControlToValidate ="SurePassword" ControlToCompare ="NewPassword" ErrorMessage ="两次输入的密码不同。"></asp:CompareValidator>
          </td>
         </tr>
           <tr>
            <td align ="left">
             <asp:Button ID ="SureBtnn" runat ="server" Text ="确定" Width ="150" />
            </td>
           </tr>
    </table> 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值