<%@ Page Language="C#" debug="true"%>
<script runat="server">
void Page_Load()
{
if (Page.IsPostBack)
{
if (Convert.ToDateTime(txtIn.Text) > Convert.ToDateTime("1/1/2000"))
{
lblOut.Text = "greater then 1/1/2000";
}
else
{
lblOut.Text = "equal or less then 1/1/2000";
}
}
}
</script>
<html>
<head><title>Demonstrate Date Comparison</title></head>
<body>
<form runat="server">
Please enter a date before, equal to or after 1/1/2000:<br>
<asp:TextBox runat="server" ID="txtIn"/><br/>
<asp:Button runat="server" Text="Submit"/><br/>
<asp:Label runat="server" ID="lblOut"/><br/>
</form>
</body>
</html>
|