Comparing a Field to a Date Data Type using the CompareValidator Control (VB.net) : Date « Validation by Function « ASP.Net






Comparing a Field to a Date Data Type using the CompareValidator Control (VB.net)

<%@ Page Language=VB Debug=true %>
<HTML>
<HEAD>
<TITLE>Comparing a Field to a Date Data Type using the CompareValidator Control</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
Please enter a Date:<BR>
<asp:textbox 
    id="txtDate" 
    runat=server 
/>
<asp:comparevalidator 
    id="cvCheckDate" 
    controltovalidate="txtDate" 
    operator="DataTypeCheck" 
    type="Date" 
    runat="server"
>
    You must enter a date!
</asp:CompareValidator><BR><BR>
<asp:button 
    id="butOK"
    text="OK"
    type="Submit"
    runat="server"
/>
</form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Checking the Range of a Date through the RangeValidator Control (VB.net)
2.Validating for a Date in the Current Year Using the CustomValidator Control (VB.net)