The message The value '' is not valid for #54577
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Describe the bug
I have a Blazor web application which uses System.ComponentModel.DataAnnotations attribute for validation in a registration form .
I have a property named NationalCode which is nullable long
I did not added [Required] attribute above my NationalCode property
But when I want to submit the form if I leave the field NationalCode empty this validation message appears :
"The value '' is not valid for 'NationalCode'."
If I change my code and add [Required] attribute like this :
Two message appears :
This is my codes :
Expected Behavior
But I want only my message appear.
Where is the first message come from ?
How can I disable it ?
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.3
Anything else?
No response
The text was updated successfully, but these errors were encountered: