Architecture — FormBuilder

Forms expressed through PageBuilder and BootstrapBuilder conventions.

1. Layer Position

DMBFormBuilder sits above PageBuilder and BootstrapBuilder. PageBuilder owns HTML composition. BootstrapBuilder provides the design vocabulary. FormBuilder adds business rules specific to forms: validation strategy, label presentation and submission attributes.

PageBuilder

HTML tags, attributes, classes, data attributes and rendering lifecycle.

HtmlBuilderBase
BootstrapBuilder

Bootstrap naming, variants, spacing and reusable visual conventions.

VariantStyle
FormBuilder

Form shell, validation strategy, submission attributes and future editor/captcha composition.

Html.FormBuilder()

2. Current Components

FormBuilder is organised around three areas that cover the full form composition lifecycle. The package is designed to keep form shell concerns in FormBuilder , while each field builder carries its own presentation and Bootstrap-compatible validation display.

Form shell pattern
// Form shell with validation and label presentation
@using (Html.FormBuilder()
    .SetAction("/Account/Login")
    .SetValidationMode(FormValidationMode.ClientAndServer)
    .DisableBrowserValidation()
    .Begin())
{
    @Html.TextFieldBuilderFor(m => m.Email)
        .SetLabelPresentation(FormLabelPresentation.Floating)
        .Render()
}

3. Extension Points

The field API is designed to grow — editors, captcha widgets and custom validation surfaces can be added without changing the form shell. FormLabelPresentation controls view-side label style per field. FormValidationMode declares validation intent at the form level.

Key FormBuilder types
// FormBuilder key types
FormBuilder          // Fluent form shell
FormLabelPresentation // Floating vs. normal labels
FormValidationMode   // Client, Server, or ClientAndServer
Tech Stack
Backend: .NET 10 / ASP.NET Core
UI: Bootstrap 5.3 form classes
Architecture: Fluent API / Builder Pattern
Integration: PageBuilder + BootstrapBuilder

Explore Further

Go back to the introduction to review the full FormBuilder overview.

Introduction