Search code examples
asp.netrequiredfieldvalidator

Avoid same messages in ValidationSummary


I've a form with several RequiredFieldValidators.

For now, when a required field isnt completed there s an "*" next to the textbox and then the message in the ValidationSummary. But when there's, for instance, 3 required field uncompleted my ValidationSummary looks like this:

  • required
  • required
  • required

How can I have only one -required?


Solution

  • You can't. Best solution for this is to set the input name (Name, Website, etc) for the error message property. Then the user can intuitively determine which field they need to fill in.