Validationattribute only when value is changed?
Posted
by boris callens
on Stack Overflow
See other posts from Stack Overflow
or by boris callens
Published on 2010-05-25T13:13:54Z
Indexed on
2010/05/27
11:01 UTC
Read the original article
Hit count: 246
I want to write a custom ValidationAttribute that checks if the given value is unique or not.
The problem is that in the edit screen, it is not guaranteed that the user actually changed the value, resulting in a false error.
Is there a way to check in my attribute whether the value actually changed? Or can I trigger the attribute only when the value has changed?
I'm getting the feeling this requirement maybe just doesn't belong in an attribute?
© Stack Overflow or respective owner