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






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

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








Related examples in the same category

1.Validation control:a postive whole number (VB.net)
2.Checking the Range of a Number through the RangeValidator Control (VB.net)
3.Validating Against a Positive Even Whole Number using the CustomValidator Control (VB.net)