views:

103

answers:

2

Why are my errors showing up beside my control and in the validation control summary?

A: 

Most likely because you did not set

Display="None"

in your validation control. By setting Display to None you are indicating that you do not want the error message to appear in the place of the validation control itself, only in the validation summary.

Andrew Hare
+2  A: 

By default if you have a ValidationSummary control, the error message shows in both places. If you want the error message to only show in the ValidationSummary, then set the "Display" property in your validation control to "None".

From ASP.NET RequiredFieldValidator Control:

The display behavior for the validation control. Legal values are:

None (the control is not displayed. Used to show the error message only in the ValidationSummary control)

Static (the control displays an error message if validation fails. Space is reserved on the page for the message even if the input passes validation.

Dynamic (the control displays an error message if validation fails. Space is not reserved on the page for the message if the input passes validation

ichiban
In the future please cite your sources.
Andrew Hare
@Andrew, thank you for the advice!
ichiban