Table of Contents

Class RegisterFormValidationRuleAttribute

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

Registers a form component validation rule to Form builder.

[Obsolete("This API is only available for legacy Form Builder components that provide backward compatibility when transitioning from older versions. The API will be removed when support for the Form Builder compatibility mode is dropped. Update your components to the new validation rules framework. See RegisterFormBuilderValidationRuleAttribute.")]
public sealed class RegisterFormValidationRuleAttribute : RegisterComponentAttribute, IPreInitAttribute
Inheritance
object
Attribute
RegisterFormValidationRuleAttribute
Implements
Inherited Members
Extension Methods

Constructors

RegisterFormValidationRuleAttribute(string, Type, string)

Initializes a new instance of the RegisterFormValidationRuleAttribute class.

public RegisterFormValidationRuleAttribute(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. The validation rule must inherit the ValidationRule class.

name string

Name of the form component validation rule.

Remarks

Make sure to provide a unique identifier for the form component validation rule from the start. This identifier is used within the form configuration of components and any further change can lead to incorrect configuration load. Consider specifying identifier in format 'CompanyName.ModuleName.ValidationRule', e.g. 'Kentico.Content.RegularExpressionValidationRule'.

Properties

Description

Description of the registered validation rule.

public string Description { get; set; }

Property Value

string

Methods

PreInit()

Registers the validation rule during application pre-initialization.

public override void PreInit()