ValidationExtensions.ValidationSummary Method (HtmlHelper)
Visual Studio 2010
Returns an unordered list (ul element) of validation messages that are in the ModelStateDictionary object.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Parameters
- htmlHelper
- Type: System.Web.Mvc.HtmlHelper
The HTML helper instance that this method extends.
Return Value
Type: System.Web.Mvc.MvcHtmlStringA string that contains an unordered list (ul element) of validation messages.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).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.
Community Additions
ADD
Show: