Click or drag to resize
ValidationRuleTValue Class
Represents a base class for a form component validation rule. Inherit this class to create custom validation rules.
Inheritance Hierarchy
SystemObject
  Kentico.Forms.Web.MvcValidationRule
    Kentico.Forms.Web.MvcValidationRuleTValue
      More...

Namespace: Kentico.Forms.Web.Mvc
Assembly: Kentico.Content.Web.Mvc (in Kentico.Content.Web.Mvc.dll) Version: 12.0.0
Syntax
C#
[SerializableAttribute]
public abstract class ValidationRule<TValue> : ValidationRule

Type Parameters

TValue
Type of value which is supposed to be validated by this rule

The ValidationRuleTValue type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyErrorMessage
Gets or sets the error message to be shown when the form component's value is invalid.
(Inherited from ValidationRule.)
Public propertyInstanceIdentifier
Gets or sets identifier of the validation rule instance.
(Inherited from ValidationRule.)
Public propertyTitle
Gets a title for this instance of validation rule.
(Inherited from ValidationRule.)
Top
Methods
  NameDescription
Public methodGetTitle
Gets a title for this instance of validation rule such as 'Maximum length is 100'.
(Inherited from ValidationRule.)
Public methodIsValueValid
Validates the form component's value and returns true if the value is valid. This method is used by system.
(Overrides ValidationRuleIsValueValid(Object).)
Public methodModifyMetadata
Modifies modelMetadata according to the current object.
(Inherited from ValidationRule.)
Protected methodValidate
Wrapped by IsValueValid(Object) which converts the value to type specified by the generic type. Override this method to apply desired validation.
Top
See Also
Inheritance Hierarchy
SystemObject
  Kentico.Forms.Web.MvcValidationRule
    Kentico.Forms.Web.MvcValidationRuleTValue
      Kentico.Forms.Web.MvcBoolIsSetValidationRule
      Kentico.Forms.Web.MvcCompareToFieldValidationRuleTValue
      Kentico.Forms.Web.MvcEmailValidationRule
      Kentico.Forms.Web.MvcMaximumIntValueValidationRule
      Kentico.Forms.Web.MvcMaximumLengthValidationRule
      Kentico.Forms.Web.MvcMinimumIntValueValidationRule
      Kentico.Forms.Web.MvcMinimumLengthValidationRule
      Kentico.Forms.Web.MvcRegularExpressionValidationRule