Table of Contents

Class RegisterFormSectionAttribute

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

Registers a section to Form builder.

public sealed class RegisterFormSectionAttribute : RegisterComponentAttribute, IPreInitAttribute
Inheritance
object
Attribute
RegisterFormSectionAttribute
Implements
Inherited Members
Extension Methods

Constructors

RegisterFormSectionAttribute(string, string, string)

Creates an instance of the RegisterFormSectionAttribute class.

public RegisterFormSectionAttribute(string identifier, string name, string customViewName = null)

Parameters

identifier string

Unique identifier of the form section definition.

name string

Name of the registered form section.

customViewName string

Custom view name for the registered form section. If not specified, the default system view name in format '~/Shared/Sections/_{identifier}' is used.

Remarks

Make sure to provide unique identifier for the section definition from the start. This identifier is used within the page configuration and any further change can lead to incorrect configuration load. Consider specifying identifier in format 'CompanyName_ModuleName_SectionName', e.g. 'Kentico_Content.SingleColumn'.

Use this attribute when simple section is being developed and no custom controller is needed.

RegisterFormSectionAttribute(string, Type, string)

Registers a simple form section using a view component.

public RegisterFormSectionAttribute(string identifier, Type viewComponentType, string name)

Parameters

identifier string

Unique identifier of the section.

viewComponentType Type

Custom view component type for the registered section.

name string

Name of the registered section.

Remarks

Make sure to provide unique identifier for the section definition from the start. This identifier is used within the page configuration and any further change can lead to incorrect configuration load. Consider specifying identifier in format 'CompanyName_ModuleName_SectionName', e.g. 'Kentico_Content_SingleColumn'.

Properties

Description

Description of the registered section.

public string Description { get; set; }

Property Value

string

IconClass

Font-icon CSS class of the registered section.

public string IconClass { get; set; }

Property Value

string

PropertiesType

Type of the section properties model. The type needs to implement the IFormSectionProperties interface.

public Type PropertiesType { get; set; }

Property Value

Type

Methods

PreInit()

Registers the section definition during application pre-initialization.

public override void PreInit()