#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    24
    Rep Power
    0

    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    NY
    Posts
    244
    Rep Power
    12
    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.

IMN logo majestic logo threadwatch logo seochat tools logo