Validation ASP.Net Tutorial

A data type check
Compare the value against a fixed value
Compare the value against another
Important properties
ControlToValidate: The ID of the form field being validated.
Text:              The error message.
Type:              The type of value being compared. 
                   Possible values are String, Integer, Double, Date, and Currency.
Operator:          The type of comparison to perform. 
                   Possible values are DataTypeCheck, Equal, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, and NotEqual.
ValueToCompare:    The fixed value.
ControlToCompare:  The ID of a control against which to compare.
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    Show Data Type Check


    
    

            id="lblBirthDate"
        Text="Birth Date:"
        AssociatedControlID="txtBirthDate"
        Runat="server" />
            id="txtBirthDate"
        Runat="server" />
            id="cmpBirthDate"
        Text="(Invalid Date)"
        ControlToValidate="txtBirthDate"
        Type="Date"
        Operator="DataTypeCheck"
        Runat="server" />
    
            id="btnSubmit"
        Text="Submit"
        Runat="server" />