tags:

views:

500

answers:

4
+1  Q: 

Range validator

In Rangevalidator one Property is Type in this Property String is available Please give me exact example of that how can we used it...

+3  A: 

The MSDN page for RangeValidator seems clear enough:

The RangeValidator control uses four key properties to perform its validation. The ControlToValidate property contains the input control to validate. The MinimumValue and MaximumValue properties specify the minimum and maximum values of the valid range.

The BaseCompareValidator.Type property is used to specify the data type of the values to compare. The values to compare are converted to this data type before the validation operation is performed.

The page for BaseCompareValidator.Type has an example of its use (for a CompareValidator, but it should show you enough).

AakashM
+3  A: 

For comparing strings use Regularexpressionvalidator instead of Rangevalidator.

In case of type string for the range validator it will only check the character by character, not the length of the string.

Eg:

I have set the range for the range validator for the type string is Minimum Value To 'A' And maximum value to 'z' (small z) then it will check whether the input character is within the range of minimum and maximum value.

rahul
I think this clarifies the OP's doubt very succinctly. +1
Cerebrus
thanks for giving such a good information
Yagnesh84
A: 

To validate say a number plate range for a certain cities in a state - range CA* - CE*

Substitue the following:

Type : String

MinimumValue = "CA*"

MaximumValue = "CF*"

use this within a standard example, as found at http://www.w3schools.com/aspnet/showasp.asp?filename=demo_rangevalidator

Thats example of range validation for string.

ForerMedia
I see why someone has downvoted you... the example you link to uses the RangeValidator to compare date types, not string types.
Cerebrus
thanks for down vote for my simple example to help Yagnesh84.
ForerMedia
ForerMedia
thanks for giving such a good information
Yagnesh84
A: 

daffsssdad

hehe