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 usually don't use the HxValidationMessage
in your code directly. It is encapsulated in HxInputXy
components.
You can select a display mode by setting the Mode
parameter. It allows you to choose between Regular
, Tooltip
, Floating
, and None
.
HxInputXy
components, the default ValidationMessageMode
is Floating
.
You can change the application-wide default by setting the HxInputBase.Defaults.ValidationMessageMode
static property.
You can disable the encapsulated validation message with ValidationMessageMode="ValidationMessageMode.None"
and use
your own instance of HxValidationMessage
.
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. |