Class ValidationRule
Represents a base class for a form component validation rule. Do not inherit this class directly, inherit the ValidationRule<TValue> class instead.
public abstract class ValidationRule
- Inheritance
-
objectValidationRule
- Derived
-
ValidationRule<TValue>
- Extension Methods
Properties
ErrorMessage
Gets or sets the error message to be shown when the form component's value is invalid.
[EditingComponent("Kentico.TextArea", Label = "{$general.errormessage$}", Order = 100)]
[Required]
public string ErrorMessage { get; set; }
Property Value
- string
InstanceIdentifier
Gets or sets identifier of the validation rule instance.
[EditingComponent("Kentico.HiddenGuidInput", Order = 1000)]
public Guid InstanceIdentifier { get; set; }
Property Value
- Guid
Title
Gets a title for this instance of validation rule.
public string Title { get; }
Property Value
- string
- See Also
Methods
GetTitle()
Gets a title for this instance of validation rule such as 'Maximum length is 100'.
public abstract string GetTitle()
Returns
- string
Returns text describing the validation rule.
IsValueValid(object)
Validates the form component's value and returns true
if the value is valid.
public virtual bool IsValueValid(object value)
Parameters
value
objectValue of the form component.
Returns
- bool
true
if the value is valid, otherwise false.