<%@ Page language="c#" Codebehind="ApplyCompareValidator.aspx.cs" AutoEventWireup="false" Inherits="ApplyCompareValidator.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
	</HEAD>
	<body>
		<h3><font face="宋体">CompareValidator 示例</font></h3>
		<p>在每个文本框中键入一个值，选择一个比较运算符，然后单击“验证”进行测试。</p>
		<form runat="server" ID="Form1">
			<table bgcolor="#eeeeee" cellpadding="10">
				<tr valign="top">
					<td>
						<h5><font face="宋体">字符串 1:</font></h5>
						<asp:TextBox id="txtComp" runat="server"></asp:TextBox>
					</td>
					<td>
						<h5><font face="宋体">比较运算符:</font></h5>
						<asp:ListBox id="lstOperator" runat="server">
							<asp:ListItem Selected="True" Value="Equal">Equal</asp:ListItem>
							<asp:ListItem Value="NotEqual">NotEqual</asp:ListItem>
							<asp:ListItem Value="GreaterThan">GreaterThan</asp:ListItem>
							<asp:ListItem Value="GreaterThanEqual">GreaterThanEqual</asp:ListItem>
							<asp:ListItem Value="LessThan">LessThan</asp:ListItem>
							<asp:ListItem Value="LessThanEqual">LessThanEqual</asp:ListItem>
						</asp:ListBox>
					</td>
					<td>
						<h5><font face="宋体">字符串 2:</font></h5>
						<asp:TextBox id="txtCompTo" runat="server"></asp:TextBox><p>
							<asp:Button runat="server" Text="验证" ID="ValidatorBtn" /></p>
					</td>
				</tr>
			</table>
			<asp:CompareValidator id="comp1" ControlToValidate="txtComp" ControlToCompare="txtCompTo" Type="String" runat="server" EnableClientScript="False">
			*</asp:CompareValidator>
			<br>
			<asp:Label ID="lblOutput" Font-Name="宋体" Font-Size="10.5pt" runat="server" />
		</form>
	</body>
</HTML>
