---
title: "How to use  RangeValidator  in asp.net"  
description: "How to use  RangeValidator  in asp.net"  
author: "Anonymous User"  
published: 2016-01-17  
updated: 2016-01-17  
canonical: https://www.mindstick.com/forum/33885/how-to-use-rangevalidator-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net", "validation"]  
reading_time: 1 minute  

---

# How to use  RangeValidator  in asp.net

I want to use [RangeValidator](https://www.mindstick.com/forum/33587/how-to-use-rangevalidator-in-asp-dot-net) in [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) how to use please help me

## Replies

### Reply by Anonymous User

The RangeValidator does exactly what the name implies; it makes sure that the user input is within a specified range. You can use it to validate both numbers, strings and number, we will try with a number.

```
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RangeVailidation.aspx.cs" Inherits="Forumasp.RangeVailidation" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title></title>     <style>      #rngsalary {          color:#EF0000;      }  </style></head> <body>    <form id="form1" runat="server">        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>        <div>            Salary:<br />            <asp:TextBox runat="server" ID="txtsalary" />            <asp:RangeValidator runat="server" ID="rngsalary" ControlToValidate="txtsalary" Type="Integer" MinimumValue="100" MaximumValue="10000" ErrorMessage="Please Enter Vailid Salary Maximum 10000 and Minimum 100!" ClientIDMode="AutoID" />            <br />            <br />        </div>    </form></body>    </html>
```

![How to use  RangeValidator  in asp.net](https://www.mindstick.com/mindstickforums/982425d2-520c-48b0-8dd7-46eb42518f41/images/4fdb0a9b-085f-4858-8349-8c6001e10b17.png)


---

Original Source: https://www.mindstick.com/forum/33885/how-to-use-rangevalidator-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
