---
title: "Range Validator Control in ASP.NET"  
description: "The RangeValidator control is used to check that the userenters an input value that falls between two values. It is possible to checkranges within num"  
author: "Uttam Misra"  
published: 2011-01-13  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/95/range-validator-control-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Range Validator Control in ASP.NET

The [RangeValidator](https://www.mindstick.com/forum/33885/how-to-use-rangevalidator-in-asp-dot-net) [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) is used to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) that the userenters an [input](https://www.mindstick.com/forum/159209/how-can-i-read-convert-an-input-stream-into-a-string-in-java) [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) that falls between two values. It is possible to checkranges within numbers, [dates](https://yourviews.mindstick.com/story/1513/7-zodiac-signs-astrology-dates-meanings-amp-compatibility), and characters.\

##### Example

```
<form id="form1"runat="server">    <asp:TextBox ID="TextBox1" runat="server"        style="z-index: 1; left: 60px; top: 55px; position: absolute"></asp:TextBox>    <asp:Button ID="Button1" runat="server"        style="z-index: 1; left: 96px; top: 109px; position: absolute" Text="Button" /> //applyingrange validator on TextBox1. Range should be between 20 to 50, otherwise itwill display error message.     <asp:RangeValidator ID="RangeValidator1" runat="server"        ErrorMessage="* value should be between 20 to 50"        style="position:absolute; top: 159px; left: 60px; width: 209px;"        ControlToValidate="TextBox1" MaximumValue="50" MinimumValue="20" Type="Integer"></asp:RangeValidator>    </form>
```

---

Original Source: https://www.mindstick.com/blog/95/range-validator-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
