I am using DA 4.0 with an MVC application and have created a custom validator as shown below:
public static ValidationResult NumberOfItems(int numItems, ValidationContext pValidationContext)
{
if (numItems == 1)
{
}
if (numItems > 1 && numItems <= 10)
{
}
return ValidationResult.Success;
}
I would like to mark the error message as a critical error or not. If this is not a critical error, I would like to access this in my view and change it differently.
So there are two parts:
- Tag malfunctions as different types in a custom validator
- Change the default ModelBinder model to identify a critical error.
How should I do it?
source
share