RangeValidator for integer type value : RangeValidator « Validation by Control « ASP.Net






RangeValidator for integer type value

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <asp:TextBox ID="txtValue" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Submit" />
        <asp:RangeValidator ControlToValidate="txtValue" 
                            ErrorMessage="RangeValidator" 
                            ID="RangeValidator1"
                            MaximumValue="20" 
                            MinimumValue="10" 
                            runat="server" 
                            Type="Integer">Between 10 and 20 please</asp:RangeValidator>
    
    </div>
    </form>
</body>
</html>

 








Related examples in the same category

1.Validation test: range (C#)
2.Rangevalidator: Enter an integer between 0 and 100 (VB.net)
3.RangeValidator Demo: The Quantity field must be from 1 to 30! (VB.net)
4.Range validator for Date type value
5.Set Focus On Error