<Script Runat="Server">
Sub Button_Click( s As Object, e As EventArgs )
If IsValid Then
Response.Redirect( "ThankYou.aspx" )
End If
End Sub
</Script>
<html>
<head><title>CompareValidator.aspx</title></head>
<body>
<form Runat="Server">
Start Date:
<asp:TextBox
id="txtStartDate"
Columns="8"
Runat="Server"/>
End Date:
<asp:TextBox
id="txtEndDate"
Columns="8"
Runat="Server"/>
<br>
<asp:CompareValidator
ControlToValidate="txtEndDate"
ControlToCompare="txtStartDate"
Display="Dynamic"
Text="End date must be greater than start date!"
Operator="GreaterThan"
Type="Date"
Runat="Server" />
<p>
<asp:Button
Text="Submit!"
OnClick="Button_Click"
Runat="Server"/>
</form>
<!--以下为本站的广告代码,请在使用代码时加以删除.本站广告代码开始-->
<script type="text/javascript"><!--
google_ad_client = "pub-4055365977023692";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!--本站广告代码结束-->
</body>
</html>