hollo的专栏

i wish you life to fill sunlight

aspdotnet about password and repassword

<!--source file=Default.aspx-->
<html>
<head>
<title>Default.aspx</title>
</head>
<body>
<center>
<h3><font face="Verdana">Text Control</font></h3>
</center>
<form id="Form1" method=post runat=server>
<hr width=600 size=1 noshade>
<br><br>
<!--title-->
    <asp:ValidationSummary ID="valSum" runat="server"
        HeaderText="please follow up write:"
        DisplayMode="SingleParagraph"
       font-name="Verdana"
        Font-Size="12"
        />

<table border=0 width=600>
    <tr>
      <td align=right>
        <font face=Arial size=2>E-mail:</font>
      </td>
      <td>
<!--input email address-->      
  <asp:TextBox id=email width=200px maxlength=60 runat=server />
      </td>
      <td>
<!--check email!->不能为空--> 
        <asp:RequiredFieldValidator id="emailReqVal"
            ControlToValidate="email"
            ErrorMessage="Email. "
            Display="Dynamic"
            Font-Name="Verdana" Font-Size="12"
            runat=server>
            *
        </asp:RequiredFieldValidator>
<!--验证邮件的有效性!->必须包含有效字符--> 
        <asp:RegularExpressionValidator id="emailRegexVal"
            ControlToValidate="email"
            Display="Static"
            ValidationExpression="^[/w-]+@[/w-]+/.(com|net|org|edu|mil)$"
            Font-Name="Arial" Font-Size="11"
            runat=server>
            不是有效邮件地址
        </asp:RegularExpressionValidator>
      </td>
    </tr>

    <tr>
      <td align=right>
        <font face=Arial size=2>密码:</font>
      </td>
      <td>
    <!--输入密码--> 
        <asp:TextBox id=passwd TextMode="Password" maxlength=20 runat=server/>
      </td>
      <td>
    <!--输入密码->密码不能为空--> 
          <asp:RequiredFieldValidator id="passwdReqVal"
              ControlToValidate="passwd"
              ErrorMessage="Password. "
              Display="Dynamic"
              Font-Name="Verdana" Font-Size="12"
              runat=server>
              *
          </asp:RequiredFieldValidator>
    <!--输入密码->包含其中有效字符--> 
          <asp:RegularExpressionValidator id="passwdRegexBal"
              ControlToValidate="passwd"
              ValidationExpression=".*[!@#$%^&*+;:].*"
              Display="Static"
              Font-Name="Arial" Font-Size="11"
              Width="100%" runat=server>
              密码必须包含 (!@#$%^&amp;*+;:)
          </asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td align=right>
        <font face=Arial size=2>再次输入密码:</font>
      </td>
      <td>
    <!--输入确认密码->--> 
        <asp:TextBox id=passwd2 TextMode="Password" maxlength=20 runat=server/>
</td>
      <td>
    <!--输入确认密码->不能为空--> 
        <asp:RequiredFieldValidator id="passwd2ReqVal"
            ControlToValidate="passwd2"
            ErrorMessage="Re-enter Password. "
            Display="Dynamic"
            Font-Name="Verdana" Font-Size="12"
            runat=server>
            *
        </asp:RequiredFieldValidator>
    <!--输入确认密码->两个密码是否相等--> 
        <asp:CompareValidator id="CompareValidator1"
            ControlToValidate="passwd2" ControlToCompare="passwd"
            Display="Static"
            Font-Name="Arial" Font-Size="11"
            runat=server>
            密码不相等
        </asp:CompareValidator>
      </td>
    </tr>
  </table>
       <input id="Submit1" runat="server" type=submit value="提交">
    <hr width=600 size=1 noshade>

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

阅读更多
个人分类: aspdotnet
想对作者说点什么? 我来说一句

js实现简单的注册验证

2017年10月19日 1.12MB 下载

ASPdotNet 教程 续

2009年04月27日 560KB 下载

没有更多推荐了,返回首页

不良信息举报

aspdotnet about password and repassword

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭