Skip to content

<ValidationSummary>

The ValidationSummary tag collects all the Message values from the form's <Validate> tags and displays them together as a list, bullet list, or paragraph. It pairs naturally with each <Validate> tag's Text attribute: each validator marks its own location with a short inline indicator (e.g. * or **), while the full sentence describing the problem appears in the summary.

You typically place one <ValidationSummary> near the form's submit buttons.

Example

A Range validator with Text="*" (inline marker next to the field) and Message="..." (full sentence in the summary):

html
<AddForm>
  ...
  <table>
    <tr>
      <td>
        <Label For="txtQuantity" Text="Number of Tickets" />
        <TextBox Id="txtQuantity" DataField="Quantity" DataType="int32" />
        <Validate Type="Range" Target="txtQuantity" MinimumValue="1" MaximumValue="5"
                  DataType="Integer" Text="*"
                  Message="You can only order between 1 and 5 tickets" />
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <AddButton Text="Place Order" />&nbsp;<CancelButton Text="Cancel" /><br />
        <ValidationSummary DisplayMode="BulletList" CssClass="NormalRed" HeaderText="Errors:" />
      </td>
    </tr>
  </table>
</AddForm>

Properties

PropertyValuesDefaultDescription
CssClassstringCSS class name(s) for styling the summary
DisplayModeList BulletList SingleParagraphBulletListHow the messages are laid out
EnableClientScriptTrue FalseTrueWhen True, the summary updates client-side as validators report errors (no postback needed)
HeaderTextstringText displayed above the message list when validation fails
HeightsizeHeight of the summary
IDstringUnique identifier for the control within the form
WidthsizeWidth of the summary
Deprecated Properties

These properties use ASP.NET inline styling and are no longer recommended for modern web development. Use the CssClass property to apply CSS classes or the Style property for inline CSS instead.

PropertyValuesDescription
BackColorcolor name | #ddddddBackground color of the summary
BorderColorcolor name | #ddddddBorder color
BorderStyleNotSet None Dotted Dashed Solid Double Groove Ridge Inset OutsetBorder style
BorderWidthsizeBorder width
Font-BoldTrue FalseBold text
Font-ItalicTrue FalseItalic text
Font-NamesstringFont family name
Font-OverlineTrue FalseOverline text decoration
Font-SizeXX-Small X-Small Small Medium Large X-Large XX-Large or sizeFont size
Font-StrikeoutTrue FalseStrikethrough text decoration
Font-UnderlineTrue FalseUnderline text decoration
ForeColorcolor name | #ddddddText color. Note: the summary hard-codes red text by default. If you set CssClass, XMP automatically clears ForeColor so your stylesheet's color rules take effect

Property Details

  • DisplayMode: How the validation messages are laid out. BulletList (the default) renders each message as a <li> inside a <ul>. List separates messages with <br>. SingleParagraph joins them into a single paragraph with spaces between.

  • HeaderText: Text rendered immediately above the message list when validation fails. Useful for framing the errors (e.g. HeaderText="Please fix the following:"). Omit for a bare list.

  • EnableClientScript: When True (the default), the summary updates in the browser as validators report errors — without requiring a postback. Set to False to update only after a server-side postback.

Pairing with <Validate> tags

The <Validate> tag has both Message and Text:

  • Message appears in the <ValidationSummary> (typically the full sentence).
  • Text appears at the validator's own location (typically a short inline marker like *).

If you don't include a <ValidationSummary>, the validator's Message falls back to displaying inline at the validator's location — which is why the Text / Message separation only matters once a summary is on the form.