HxValidationMessage

Displays a list of validation messages for a specified field within a cascaded HxValidationMessage.EditContext.
Reimplementation of Blazor ValidationMessage as Bootstrap 5 validation.
Used by HxInputBase and derived components.

You usualy don't use the HxValidationMessage in your code directly. It is encapsulated in HxInputXy components.

Display modes #

You can select display mode by setting the Mode parameter. It allows you to choose between Regular, Tooltip, Floating and None.

Custom validation message #

You can disable the encapsulated validation message with ValidationMessageMode="ValidationMessageMode.None" and use your own instance of HxValidationMessage.

API

Parameters

Name Type Description
EditContext EditContext EditContext. For exceptional use where EditContext is not used as a CascadingParameter.
For Expression<Func<TValue>> Specifies the field for which validation messages should be displayed. Mutual exclusive with ForFieldName and ForFieldNames.
ForFieldName string Specifies the field for which validation messages should be displayed. Mutual exclusive with For and ForFieldNames.
ForFieldNames string<> Specifies the field for which validation messages should be displayed. Mutual exclusive with For and ForFieldName.
Mode ValidationMessageMode Specifies how the validation message should be displayed.
An unhandled error has occurred. Reload 🗙