Getting Started — FormBuilder

Start with the form shell, then migrate editors and captcha into dedicated components.

1. Reference the Package

Add DMBFormBuilder to the project that hosts your form views. It sits above PageBuilder and BootstrapBuilder in the DMB stack.

Project file (.csproj)
<PackageReference Include="DMBFormBuilder" Version="0.9.0" />

2. Configure Services

Register FormBuilder services after PageBuilder and BootstrapBuilder so the form shell has access to the full rendering pipeline.

Program.cs
using DMBFormBuilder;

FormBuilderConfiguration.LoadCommonConfig(builder);

3. Add the Namespace

Add the FormBuilder namespace to _ViewImports.cshtml to make form builders available in all your views.

_ViewImports.cshtml
@using DMBFormBuilder

4. Create a Form

Compose a form shell with floating labels. Each field builder carries its own label presentation and Bootstrap-compatible validation display.

Form with floating label
@using (Html.FormBuilder()
    .SetAction("/Account/Login")
    .SetValidationMode(FormValidationMode.ClientAndServer)
    .DisableBrowserValidation()
    .Begin())
{
    @Html.TextFieldBuilderFor(m => m.Email)
        .SetLabelPresentation(FormLabelPresentation.Floating)
        .Render()
}
Key Methods
Html.FormBuilder()
.SetFloatingLabel()
.SetValidationMode(...)
.DisableBrowserValidation()
.TextFieldBuilderFor(...)

Understand how FormBuilder layers on top of PageBuilder and BootstrapBuilder?

Check out the architecture guide to understand how FormBuilder is structured and integrates with the rendering lifecycle.

Architecture