Export (0) Print
Expand All

ValidationExtensions.ValidationSummary Method

Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member ValidationSummary(HtmlHelper) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.
Public method Static member ValidationSummary(HtmlHelper, Boolean) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object and optionally displays only model-level errors.
Public method Static member ValidationSummary(HtmlHelper, String) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.
Public method Static member ValidationSummary(HtmlHelper, Boolean, String) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object and optionally displays only model-level errors.
Public method Static member ValidationSummary(HtmlHelper, String, IDictionary<String, Object>) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.
Public method Static member ValidationSummary(HtmlHelper, String, Object) Returns an unordered list (ul element) of validation messages in the ModelStateDictionary object.
Public method Static member ValidationSummary(HtmlHelper, Boolean, String, IDictionary<String, Object>) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object and optionally displays only model-level errors.
Public method Static member ValidationSummary(HtmlHelper, Boolean, String, Object) Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object and optionally displays only model-level errors.
Top

The ValidationSummary method displays a list of all validation messages on the page.

If the DefaultModelBinder instance cannot bind a form-field value to the model, the binder adds an error to the ModelState object. When the view is rendered, the validation messages and validation summary are displayed based on the Errors property of the ModelState object.

Show:
© 2014 Microsoft