1.

What is the use of Validation Summary?

Answer»
  • The Validation Summary helper method is USEFUL in unordered list(UL element) generation that belongs to validation messages present in the object of MODEL State Dictionary.
  • It can be used for displaying all error messages RELATED to all the fields. Also, it can be used for displaying custom error messages.
  • ValidationSummary will not only display the first MESSAGE for any property instead it displays all error messages on the page. If you pass the first parameter value as true to ValidationSummary, only the messages having String.Empty as their name will be displayed.

For example, the below-given code will display a heading “Please fix the problem:” for a list of all the String.Empty messages. @Html.ValidationSummary(True, "Please fix the problem:")



Discussion

No Comment Found