The RangeValidator Control

The RangeValidator control enables you to specify a range for the values entered into the input control. Such a range would be applicable if you have a B2B e-commerce site, and you wanted to set minimum and maximum order rates on some products. There are two ways to specify the minimum and maximum values. The first is to set the MinimumValue and Maximum Value to specified values. The second is to set the MinimumControl and MaximumControl values with the ID value of other HTML controls. As with the CompareValidator control, you can assign the range's data type with the Type attribute of the RangeValidator control.

Listing 9.7 contains an example using the RangeValidator. This is a very simple example that checks an integer ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.