HtmlHelper.ValidationSummary Method (String)

Returns an HTML div element that contains a summary message and 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)


Public Function ValidationSummary ( _
    message As String _
) As IHtmlString
Dim instance As HtmlHelper 
Dim message As String 
Dim returnValue As IHtmlString 

returnValue = instance.ValidationSummary(message)
public IHtmlString ValidationSummary(
    string message
IHtmlString^ ValidationSummary(
    String^ message
member ValidationSummary : 
        message:string -> IHtmlString
public function ValidationSummary(
    message : String
) : IHtmlString


  • message
    Type: System.String
    The message that comes before the list of validation error messages.

Return Value

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


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:

    <li>summary message</li>
    <li>summary message</li>

Each summary message contains a validation error message that is associated with a model-level and field-level error in the model-state dictionary.

See Also


HtmlHelper Class

ValidationSummary Overload

System.Web.WebPages.Html Namespace