Sams Teach Yourself ASP.NET in 21 Days, Second Edition By Chris Payne
Table of Contents
Day 7. Validating ASP.NET Pages
Do I have to validate on the server side as well as the client side?
The dynamic error messages aren't being displayed. What's wrong?
Be sure that you've tried to submit the form at least once. The error messages will appear after the first attempt to submit (that is, if the input is invalid). After the first post, the dynamic messages should appear and disappear automatically when you move through the UI elements.
Also, make sure that you're using a newer browser version that supports DHTML (IE or Netscape 4+).
When should I use Validation controls?
Whenever you need to! Validating input is a must for any serious application, and the Validation controls make it very easy in ASP.NET.
If you're in a performance-critical situation where bandwidth is a precious commodity, or if you know that you'll have clients with older browsers, it may be wise to stick with the traditional form of validation. That is, stick with if and case statements on the server.