PDA

View Full Version : Validation messages best practices


CNemo7539
06-25-2007, 06:15 PM
I will appreciate if somebody share subj.
I need to be able have one message source for windows forms and web application.

By some weird coincidence in case study project I've used message id as a place holder for message text... I don't know why i decided to do that, it was just something what came to my mind when I started to play with spring. Then I have discovered param as well. Interesting enough id played well with them :-) Something like this:

<v:message id="Named insured must be 18 or older. Driver #{0}" providers="DefaultValidationProvider">
<v:param value="Index + 1"/>
</v:message>

Calling code was calling String.Format(id, params)

Now I think it's just plain wrong.

Could somebody advise something proven and flexible enough?