IHtmlHelper.ValidationSummary(Boolean, String, Object, String) IHtmlHelper.ValidationSummary(Boolean, String, Object, String) IHtmlHelper.ValidationSummary(Boolean, String, Object, String) Method

Definition

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

public Microsoft.AspNetCore.Html.IHtmlContent ValidationSummary (bool excludePropertyErrors, string message, object htmlAttributes, string tag);
abstract member ValidationSummary : bool * string * obj * string -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function ValidationSummary (excludePropertyErrors As Boolean, message As String, htmlAttributes As Object, tag As String) As IHtmlContent

Parameters

excludePropertyErrors
Boolean Boolean Boolean

If true, display model-level errors only; otherwise display all errors.

message
String String String

The message to display with the validation summary.

htmlAttributes
Object Object Object

An Object that contains the HTML attributes for the topmost (<div>) element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

tag
String String String

The tag to wrap the message in the generated HTML. Its default value is ValidationSummaryMessageElement.

Returns

New IHtmlContent containing a <div> element wrapping the tag element and the <ul> element. An empty IHtmlContent if the current model is valid and client-side validation is disabled.

Applies to