Here i have explained how to use RangeValidator control in Asp.Net.

The RangeValidator control ensures that the typed value is within range.

HTML Markup

<asp:TextBox ID="TextBox1" placeholder="Age" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TextBox1" Display="Dynamic"
     runat="server" ErrorMessage="Enter your age"></asp:RequiredFieldValidator>

Screenshot

Add Comments