文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>asp.net里面几个常用的验证控件

asp.net里面几个常用的验证控件

时间:2007-06-16  来源:kvsg_yang

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <tr>
  <td>
   
       <td>
           <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
           <br />
           用户ID:</td>
          
       <td><input id="txtName" type="text" runat="server" /> </td>
       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="请输入密码">*
     </asp:RequiredFieldValidator></td>
    ;&nbsp;
        <br />
        用户密码:<asp:TextBox ID="password" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="password" ErrorMessage="请输入密码">*</asp:RequiredFieldValidator>
        <asp:CompareValidator ID="CompareValidator1" ControlToValidate="password" ControlToCompare="repassword" runat="server" ErrorMessage="两次密码输入不同">*</asp:CompareValidator><br />
        再次输入密码:<asp:TextBox ID="repassword" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="repassword" ErrorMessage="请输入重复密码">*</asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="repassword" runat="server" ValidationExpression="[0-9]" ErrorMessage="输入必须为数字"></asp:RegularExpressionValidator><br />
   <asp:Button id="Button1" runat="server" Text="验证" /></div>
    </form>
</body>
</html>

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载