Usually, if you keep following the thread you will likely find someone post, "it's situations like that that have caused me to not use the validation controls..." Most recently, it was an MVP who seems to be everywhere. But an answer like this makes me wonder about any answer he's likely to give on the forum.
Are some situations more difficult than others? Indeed. Should we not use them at all because of those situations? Well, let's do a cost benefit analysis:
Using validation controls gives us:
Writing minimum code using client side and server side validation
* Allows us to assign a validation to a specific control
* Allows us to group validations and controls so that only specific validations fire for specific regions of the screen.
* There are actually multiple consistent ways to report the validation error back to the user.
* It is unnecessary to learn JavaScript
* Provides a custom validation control for the rare case which conforms to how the other validation controls work so that all we have to do is write the validation but displaying the error message, firing the validation, etc is left to the framework.
* I might have to have multiple validations and multiple controls on the screen that do the very same thing for the reason that any specific control or validation may only belong to one validation group.
With these points, It seems as if using validation controls would be much quicker.
Not using validation controls could mean:
I'm stuck writing validations by hand myself or using some other framework (one I probably wrote myself and therefore isn't tested as well)
* I have to write code to display the error on the screen.
* I must be consistent in how the error is displayed from one screen to another. Especially when you are working with several different developers, this could be problematic.
* Each of the developers in my organization have to know asp.net AND javascript..
* I can code validations any way I want.
* I might have greater code re-use.
Sorry, I'm not seeing a big benefit here. Actually, In my own experience with ASP.NET applications since beta 1 of version 1.0, I've yet to see a situation where the validation controls wouldn't work or where anyone could dispute that they were not the proper solution. This is even more so the case now that we can group the controls and validations.
So, here's the challenge.
Find a situation you think will not work using the existing set of validation controls and post a comment with your specific situation.. Maybe someone can change my mind.