# <ValidationSummary>

The <ValidationSummary> tag is used to group the display of all validation messages generated by <Validate> tags. The tags' Message value(s) will be displayed in the validation summary, while the tags' Text value(s) will be displayed in place of the <Validate> tag.

# Syntax

<ValidationSummary
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|Inset|Outset"
    BorderWidth="size"
    CssClass="string"
    DisplayMode="List|BulletList|SingleParagraph"
    EnableClientScript="True|False"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    HeaderText="string"
    Height="size"
    Width="size" 
/> 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# Remarks

  • BackColor: Color of the background of the control.

  • BorderColor: Color of the border around the control.

  • BorderStyle: Style of the border around the control. Defaults to NotSet.

  • BorderWidth: Width of the border around the control, specified in units

  • CssClass: Name of the Cascading Style Sheets (CSS) class used to style this control.

  • DisplayMode: This attribute determines the layout of the message when validation fails. Defaults to BulletList display.

  • EnableClientScript: Use this property to specify whether the control updates itself using client-side script. When this property is set to true, client-side script is rendered on the client to update the <ValidationSummary> control, if the browser supports that feature.

  • Font Properties: A series of attributes such as font-bold, font-size, etc. that allow you to control how the text in the control is displayed. More

  • HeaderText: This will be displayed above your <ValidationSummary> tag when validation fails.

  • Height: Height of the control, specified in units.

  • Width: Width of the control in units.

# Example

In the example below, a Range Validator has been placed on the form in addition to a Validation Summary. The Range Validator has its Message set to "You can only order between 1 and 5 tickets" and has its Text set to *. When validation fails, the Range Validator will display next to the text box, while the Validation Summary, below the form's button, will display the error message. If there were additional validation errors, they would also be displayed in the ValidationSummary.

<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" Message="You can only order between 1 and 5 tickets" 
          Type="Integer" Text="*" />
      </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>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20