Share via


HtmlHelper.ValidationSummary Method (Boolean)

Returns an HTML div element that contains an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors.

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Function ValidationSummary ( _
    excludeFieldErrors As Boolean _
) As IHtmlString
'Usage
Dim instance As HtmlHelper 
Dim excludeFieldErrors As Boolean 
Dim returnValue As IHtmlString 

returnValue = instance.ValidationSummary(excludeFieldErrors)
public IHtmlString ValidationSummary(
    bool excludeFieldErrors
)
public:
IHtmlString^ ValidationSummary(
    bool excludeFieldErrors
)
member ValidationSummary : 
        excludeFieldErrors:bool -> IHtmlString
public function ValidationSummary(
    excludeFieldErrors : boolean
) : IHtmlString

Parameters

  • excludeFieldErrors
    Type: System.Boolean
    true to exclude field-level validation error messages from the list; false to include both model-level and field-level validation error messages.

Return Value

Type: System.Web.IHtmlString
The HTML markup that represents the validation error messages.

Remarks

This method is used in conjunction with the System.Web.Helpers.Validation class.

The returned markup consists of an HTML div element in the following form:

<div>
  <ul>
    <li>summary message</li>
    <li>summary message</li>
    ...
  <ul>
</div>

Each summary message value contains a validation error message that is associated with an error in the model state. If excludeFieldErrors is true, field-level errors are excluded from the list; otherwise, both model-level and field-level errors are included.

See Also

Reference

HtmlHelper Class

ValidationSummary Overload

System.Web.WebPages.Html Namespace