Featured On ...

asp.net

totalasp.co.uk

fuzzysoftware.com

devdex.com

123aspx.com

dotnetfreaks.com

411asp.net

and more ...

ValidatorEntry

Full path

MadWidgets.Validation.ValidatorEntry

Declaration

public abstract class ValidatorEntry

Overview

The ValidatorEntry class is the base class for all validation entries. Instances of this class are added to the Validator control for validation. Each subclass of this class represents a particular type of validation rule. The ValidatorEntry class does not by itself perform any validation as this is left up to the subclasses. Subclasses must override the abstract method RunValidation of the ValidatorEntry class.

Constructors

Public properties

Public methods

Public static methods

Protected methods


Constructors

ValidatorEntry

public ValidatorEntry(string sMessage, bool bNegate)

Creates a ValidatorEntry object with the supplied message and negation. If negate is true, the result of RunValidation is negated and can be accessed via the IsValid property.

Public properties

ErrorMessage

public virtual string ErrorMessage {get;}

Returns the error message supplied in the constructor.

FirstObject

public virtual object FirstObject {get;}

Returns the first object being validated by the ValidatorEntry subclass. This property must be overridden by the subclass if the subclass can be used inside a validation group. The FirstObject is also used in the "show me" anchor of the validation summary message. The "show me" anchor links to the client-side object that FirstObject represents.

IsValid

public virtual bool IsValid {get;}

Returns true if the ValidatorEntry is in a true state. This is normally called by the Validator control when Validator.IsValid {get;} is called. The initial valid state of all ValidatorEntry objects is true except the ValidatorEntryPreset which is false.

Negate

public virtual bool Negate {get;}

Returns the negate state of the ValidatorEntry object. If the entry is set to negate (as determined by the negate parameter of the constructor), the result of the RunValidation method is negated before it is stored in the valid flag.

Public methods

ContainsObject

public bool ContainsObject(object o)

Returns true if this entry or any sub entry of this entry contains the object passed.

Validate

public void Validate()

Forces the ValidatorEntry to validate itself. This is called by the Validator control when the Validate() method of the control is called.

Public static methods

GetGroupForObject

public static string GetGroupForObject(object o)

See GetGroupForObject from the Validator control.

GetObjectId

public static string GetObjectId(object o)

See GetObjectId from the Validator control.

GetValidationValue

public static string GetValidationValue(object o)

See GetValidationValue from the Validator control.

StringToClientSide

public static string StringToClientSide(string sText)

See StringToClientSide from the Validator control.

Protected methods

RunValidation

protected abstract bool RunValidation()

Called internally when the ValidatorEntry object is instructed to validate itself. Subclasses of the ValidatorEntry must override this method.

© 2002 - 2009 Copyright, Disclaimer and Privacy Statement