Table of Contents

Class ValidationRuleDefinition

Namespace
Kentico.Forms.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll

Definition of a registered form component validation rule.

public class ValidationRuleDefinition : ComponentDefinitionBase, IFormBuilderDefinition, IComponentDefinition
Inheritance
object
ValidationRuleDefinition
Implements
Inherited Members
Extension Methods

Constructors

ValidationRuleDefinition(string, Type, string)

Initializes a new instance of the ValidationRuleDefinition class using given identifier, form component validation rule type and name.

public ValidationRuleDefinition(string identifier, Type validationRuleType, string name)

Parameters

identifier string

Unique identifier of the form component validation rule.

validationRuleType Type

Type of the form component validation rule.

name string

Name of the form component validation rule.

Exceptions

ArgumentException

Specified identifier is null, an empty string or identifier does not specify a valid code name.

-or-

Specified validationRuleType does not inherit ValidationRule, is an abstract type or is a generic type which is not constructed.

-or-

Specified name is null or an empty string.

ArgumentNullException

Thrown when validationRuleType is null.

Properties

Description

Gets or sets the description of the form component validation rule.

public string Description { get; set; }

Property Value

string

ValidatedDataType

Value type, which this validation rule is supposed to validate.

public Type ValidatedDataType { get; }

Property Value

Type

ValidationRuleType

Gets the type of the form component validation rule. The type inherits ValidationRule.

public Type ValidationRuleType { get; }

Property Value

Type