Currently, when using StringLength or MaxLength attribute, it only prevents further text input after the defined limit is reached, but without displaying a validation message.
Code (model):
[Display(Name = "Naslovnik")]
[Required(ErrorMessageResourceName = "UI_Validation_RequiredValidator",ErrorMessageResourceType = typeof(ResourceUI))] //custom error message
[StringLength(20, ErrorMessage = "Naslovnik can be a maximum of 100 characters long.")]
//[MaxLength(20)]
public string Naslovnik { get; set; } = string.Empty;
Please suggest how to enable the validation message on the client-side.