<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Ex3-5.aspx.cs" Inherits="Ex3_5" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Ex3-5</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        姓名：<asp:TextBox ID="txtname" runat="server"></asp:TextBox>
        <br />
        身份证号：<asp:TextBox ID="txtcard" runat="server" Width="164px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ControlToValidate="txtcard" ValidationExpression="\d{17}[\d|X]|\d{15}">身份证格式不对
        </asp:RegularExpressionValidator>
        <br />
        Email：<asp:TextBox ID="txtmail" runat="server" Width="205px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
            ControlToValidate="txtmail" 
            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">邮箱格式不对
        </asp:RegularExpressionValidator>
        <br />
        固定电话：<asp:TextBox ID="txttel" runat="server" Width="161px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
            ControlToValidate="txttel" ValidationExpression="(\(\d{3}\)|\d{3}-)?\d{8}">电话格式不对
        </asp:RegularExpressionValidator>
        <br />
        邮编：<asp:TextBox ID="txtpost" runat="server" Width="104px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
            ControlToValidate="txtpost" ValidationExpression="\d{6}">邮编格式不对</asp:RegularExpressionValidator>
        <br />
        <asp:Button ID="Button1" runat="server" Text="提交" />
    </div>
    </form>
</body>
</html>
