<%@ Page language="c#" Codebehind="ApplyRegularExpressionValidator.aspx.cs" AutoEventWireup="false" Inherits="ApplyRegularExpressionValidator.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
	</HEAD>
	<body>
		<h3><font face="宋体">简单的 RegularExpressionValidator 示例</font></h3>
		<form id="Form1" runat="server">
			<table cellPadding="10" bgColor="#eeeeee">
				<tr vAlign="top">
					<td colspan="3">
						<asp:Label ID="lblOutput" Text="输入 5 位数字的邮政编码" Font-Name="宋体" Font-Size="10.5pt" runat="server" />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<font face="宋体" size="2"><b>个人信息</b></font>
					</td>
				</tr>
				<tr>
					<td align="right">
						<font face="宋体" size="2">邮政编码:</font>
					</td>
					<td>
						<ASP:TextBox id="TextBox1" runat="server" />
					</td>
					<td>
						<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" ValidationExpression="^\d{5}$" Display="Static" Font-Name="verdana" Font-Size="10pt" EnableClientScript="False">
                 邮政编码必须是 5 位数字
          </asp:RegularExpressionValidator>
					</td>
				</tr>
				<tr>
					<td></td>
					<td>
						<ASP:Button text="验证" runat="server" ID="ValidatorBtn" />
					</td>
					<td></td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
