I've got a web page where user enters a bunch of info, which gets validated by a client and server validation. If both validations succeed (user pressed Submit button) then the above mentioned info is stored in DB.
Everything works handy dandy, except for the rare case where the insert into DB can come back with an exception. One of the exceptions is that the data entered by user already exists in DB.
I am able to catch this exception, but I don't know now how to trigger one of the validators attached to the field to display the error.
I've tried explicitly setting validator's I've tried googling extensively and did not find any clear solutions.IsValid
property to false with no visible result.
I did not like the idea of performing the DB validation on the specific validator's server validation functions, because in this case I do 2 DB hits - one on validator's server validation and one when actually submitting data.
Any ideas?