Name
CompareValidator
Synopsis
This class represents a validation control that compares the input control
(ControlToValidate) to a
specified value (ValueToCompare)
or a value in another control (ControlToCompare).
Both values will be converted to the data type specified by Type before they are
compared. Note that if you set both ValueToCompare and ControlToCompare, the latter will take precedence.
The Operator property
specifies the expression that must be met in order for validation to succeed. In
other words, ControlToValidate <Operator> ControlToCompare
must be true.
Public Class CompareValidator : Inherits BaseCompareValidator ' Public Constructors Public Sub New() ' Public Instance Properties Public Property ControlToCompare As String Public Property Operator As ValidationCompareOperator Public Property ValueToCompare 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→ CompareValidator
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access