Name
RangeValidator
Synopsis
This class represents a validation control that tests to make sure the value of the
input control
(ControlToValidate
) is
equal to or between the MinimumValue
and MaximumValue
. All values
will be converted to the data type specified by CompareValidator.Type
before validation is performed. Valid data types include integer, double, date, currency,
and string (which uses an alphabetic character-code based comparison).
Validation automatically succeeds if the input control is empty. To require a value,
use the RequiredFieldValidator
control
in addition to the RangeValidator
control.
Public Class RangeValidator : Inherits BaseCompareValidator ' Public Constructors Public Sub New() ' Public Instance Properties Public Property MaximumValue As String Public Property MinimumValue As String ' Protected Instance Methods Overrides Protected Sub AddAttributesToRender( ByVal writer As System.Web.UI.HtmlTextWriter) Overrides Protected Function ControlPropertiesValid() As Boolean Overrides Protected Function EvaluateIsValid() As Boolean End Class
Hierarchy
System.Object→ System.Web.UI.Control(System.ComponentModel.IComponent
, System.IDisposable
, System.Web.UI.IParserAccessor
, System.Web.UI.IDataBindingsAccessor)→WebControl(System.Web.UI.IAttributeAccessor)→Label→BaseValidator(System.Web.UI.IValidator)→BaseCompareValidator→ RangeValidator
Get ASP.NET in a Nutshell 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.