September 11th, 2003, 11:34 AM
ASP.NET Validation Controls
I have a quick question regarding the validation controls in ASP.NET.
How much control over them do I have? Let's say for instance, that I have multiple text boxes. Each of the textboxes must be filled. However, If none of the text boxes are filled, I only want to post one error message, not an error message for each one that fails.
Also, if an error is detected, is it possible to somehow send a message to the client signaling that the page focus should be set to the field that has an error.
The validation controls seem very cool, however, they seem somewhat incomplete.
Thanks for your input.
September 12th, 2003, 08:41 AM
You can use the <asp:ValidationSummary Runat="Server" /> control to combine all of the errors into one message. In the individual RequiredFieldValidator controlls, you can set the Display="None" so that you don't get an error for each one.