Class EPiServerValidator

A server-side validator control that validates values for EPiServer controls.

Inheritance
System.Object
EPiServerValidator
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class EPiServerValidator : CustomValidator
Remarks

This validator can be used if you need to input data for controls derived from PropertyData, and you are not using a PropertyDataForm.

Constructors

EPiServerValidator()

Initializes a new instance of the EPiServerValidator class.

Declaration
public EPiServerValidator()

EPiServerValidator(String, Type)

Initializes a new instance of the EPiServerValidator class.

Declaration
public EPiServerValidator(string controlID, Type controlType)
Parameters
Type Name Description
System.String controlID

The control ID.

System.Type controlType

Type of the control.

EPiServerValidator(String, Type, Boolean)

Initializes a new instance of the EPiServerValidator class.

Declaration
public EPiServerValidator(string controlID, Type controlType, bool isRequired)
Parameters
Type Name Description
System.String controlID

The control ID.

System.Type controlType

Type of the control.

System.Boolean isRequired

if set to true [is required].

Properties

DisplayName

Gets or sets the display name.

Declaration
public string DisplayName { get; set; }
Property Value
Type Description
System.String

The display name.

IsRequired

Gets or sets a value indicating whether this validator instance is of type required.

Declaration
public bool IsRequired { get; set; }
Property Value
Type Description
System.Boolean

true if this instance is required; otherwise, false.

PropertyType

Gets or sets the type of the control

Declaration
public Type PropertyType { get; set; }
Property Value
Type Description
System.Type

The type of the property.

Methods

AddRequiredValidator(WebControl, Type)

Adds the EPiServerValidator as a required validator.

Declaration
public static EPiServerValidator AddRequiredValidator(WebControl control, Type controlType)
Parameters
Type Name Description
System.Web.UI.WebControls.WebControl control

The control.

System.Type controlType

Type of the control.

Returns
Type Description
EPiServerValidator

AddValidator(WebControl, Type)

Adds an EPiServerValidator to a control

Declaration
public static EPiServerValidator AddValidator(WebControl control, Type controlType)
Parameters
Type Name Description
System.Web.UI.WebControls.WebControl control

The control.

System.Type controlType

Type of the control.

Returns
Type Description
EPiServerValidator

EvaluateIsValid()

Overrides the System.Web.UI.MobileControls.BaseValidator.EvaluateIsValid method.

Declaration
protected override bool EvaluateIsValid()
Returns
Type Description
System.Boolean

true if the value in the input control is valid; otherwise, false.

ParseValidation(Object, ServerValidateEventArgs)

Tries to parse the value as a PropertyData. If parsing is successful validation passes.

Declaration
public void ParseValidation(object source, ServerValidateEventArgs args)
Parameters
Type Name Description
System.Object source

The source.

System.Web.UI.WebControls.ServerValidateEventArgs args

The System.Web.UI.WebControls.ServerValidateEventArgs instance containing the event data.

Extension Methods