I have this code :
[Required(ErrorMessage = "Password is required")]
[DisplayName("Password")]
public string Password { get; set; }
I’d like, in some case, in my controller force the ModelState to false and show an error on the password field but with a different ErrorMessage
Is it possible ?
Thanks,
You can do this…
so in your case something like that.
the key is the name of the property.
hope this helps