HtmlHelper.ValidationSummary Method (IDictionary<String, Object>)
Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains an unordered list of all validation error messages that are in the model-state dictionary.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function ValidationSummary ( _
htmlAttributes As IDictionary(Of String, Object) _
) As IHtmlString
'Usage
Dim instance As HtmlHelper
Dim htmlAttributes As IDictionary(Of String, Object)
Dim returnValue As IHtmlString
returnValue = instance.ValidationSummary(htmlAttributes)
public IHtmlString ValidationSummary(
IDictionary<string, Object> htmlAttributes
)
public:
IHtmlString^ ValidationSummary(
IDictionary<String^, Object^>^ htmlAttributes
)
member ValidationSummary :
htmlAttributes:IDictionary<string, Object> -> IHtmlString
public function ValidationSummary(
htmlAttributes : IDictionary<String, Object>
) : IHtmlString
Parameters
- htmlAttributes
Type: System.Collections.Generic.IDictionary<String, Object>
The names and values of custom attributes for the element.
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 ...htmlAttributes...>
<ul>
<li>summary message</li>
<li>summary message</li>
...
<ul>
</div>
Each summary message contains a validation error message that is associated with a model-level and field-level error in the model-state dictionary.