RangeValidator Demo: The Quantity field must be from 1 to 30! (VB.net)
<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Data" %>
<script runat=server>
</SCRIPT>
<HTML>
<HEAD>
<TITLE>CompareValidator Control Sample Page</TITLE>
</HEAD>
<BODY >
<form runat="server">
<Font Face="Tahoma">
<BR><BR>
<asp:Label
id="lblMessage"
runat="server"
Font-Bold="True"
Text="Quantity"
/>
<asp:TextBox
id="txtQuantity"
Columns="25"
MaxLength="30"
runat=server
/>
<asp:RangeValidator
id="rngQuantity"
ControlToValidate="txtQuantity"
Type="Integer"
MinimumValue=1
MaximumValue=30
Display="Dynamic"
Font-Name="Verdana"
Font-Bold="True"
Font-Size="10pt"
runat="server">
The Quantity field must be from 1 to 30!
</asp:RangeValidator>
<BR><BR>
<asp:Label
id="lblMessage2"
runat="server"
Font-Bold="True"
Text="Date"
/>
<asp:TextBox
id="txtDate"
Columns="25"
MaxLength="30"
runat=server
/>
<asp:RangeValidator
id="rngDate"
ControlToValidate="txtDate"
Type="Date"
MinimumValue="1/1/2000"
MaximumValue="12/31/2010"
Display="Dynamic"
Font-Name="Verdana"
Font-Bold="True"
Font-Size="10pt"
runat="server">
The Date field must be from 1/1/2000 to 12/31/2001!
</asp:RangeValidator>
<BR><BR>
<asp:button
id="butOK"
text="OK"
Type="Submit"
runat="server"
/>
</Font>
</Form>
</BODY>
</HTML>
Related examples in the same category