Social Icons

Saturday, 18 May 2013

How to use RangeValidator Control in Asp.Net with C# Example


RangeValidator Control Example:

Introduction:

In my previous article i explained overview of ValidationControls in Asp.net,How to use requiredfieldvalidator in Asp.Net.Now i will explain How to use RangeValidator Control in Asp.Net.

Description:

You can use the ASP.NET RangeValidator control to determince whether a user's entry falls within specific range of values - for example, between two numbers, between two dates or between alphabetic characters.
You set the upper and lower bounds of the range as properties of a RangeValidator Control. You must also specify the data type of the values that the control will validate.

To Use this:

1). Add a RangeValidator control to the page and set the properties ControlToValidate,ErrorMessage,Text and Display.
2). Set the low and high values of the range using MinimumValue and Maximumvalue properties.
3). Set the type property to specify the datatype of the range settings. use the ValidationDataType enumeration, which enables you to specify the following types
  • String
  • Integer
  • Double
  • Date
  • Currency

RangeValidator Example phone number and Date Validation:

 



Related Tutorials







No comments:

Post a Comment

Please Give your Valuable Suggestions,Questions and Comments to improve my blog.