ValidationSummary
ValidationSummary Example
|
|
@inherits ControlComponent
<table cellpadding="10">
<tr>
<td>
<table cellpadding="10" style="background-color:#eeeeee;">
<tr>
<td colspan="3">
<b>Credit Card Information</b>
</td>
</tr>
<tr>
<td align="right">
Card Type:
</td>
<td>
<asp.RadioButtonList ID="RadioButtonList1"
RepeatLayout="RepeatLayout.Flow">
<asp.ListItem>MasterCard</asp.ListItem>
<asp.ListItem>Visa</asp.ListItem>
</asp.RadioButtonList>
</td>
<td align="center" rowspan="1">
<asp.RequiredFieldValidator ID="RequiredFieldValidator1"
ControlToValidate="RadioButtonList1"
ErrorMessage="Card Type. "
Display="ValidatorDisplay.Static"
InitialValue="" Width="100%">
*
</asp.RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
Card Number:
</td>
<td>
<asp.TextBox id="TextBox1" />
</td>
<td>
<asp.RequiredFieldValidator ID="RequiredFieldValidator2"
ControlToValidate="TextBox1"
ErrorMessage="Card Number. "
Display="ValidatorDisplay.Static"
Width="100%">
*
</asp.RequiredFieldValidator>
</td>
</tr>
<tr>
<td></td>
<td>
<asp.Button Text="Validate" />
</td>
<td></td>
</tr>
</table>
</td>
<td valign="top">
<table cellpadding="20">
<tr>
<td>
<asp.ValidationSummary ID="valSum"
DisplayMode="ValidationSummaryDisplayMode.BulletList"
HeaderText="You must enter a value in the following fields:"
FontNames="verdana"
FontSize="12" />
</td>
</tr>
</table>
</td>
</tr>
</table>
@code {
}
ValidationSummary Metadata
Name | Type | Kind |
---|---|---|
AccessKey | String | Parameter |
Attributes | IReadOnlyDictionary | Parameter |
BackColor | String | Parameter |
BorderColor | String | Parameter |
BorderStyle | BorderStyle | Parameter |
BorderWidth | String | Parameter |
ClientIDMode | ClientIDMode | Parameter |
CssClass | String | Parameter |
DisplayMode | ValidationSummaryDisplayMode | Parameter |
EnableClientScript | Boolean | Parameter |
Enabled | Boolean | Parameter |
FontBold | Boolean | Parameter |
FontItalic | Boolean | Parameter |
FontNames | String | Parameter |
FontOverline | Boolean | Parameter |
FontSize | String | Parameter |
FontStrikeout | Boolean | Parameter |
FontUnderline | Boolean | Parameter |
ForeColor | String | Parameter |
HeaderText | String | Parameter |
Height | String | Parameter |
ID | String | Parameter |
ShowMessageBox | Boolean | Parameter |
ShowModelStateErrors | Boolean | Parameter |
ShowSummary | Boolean | Parameter |
ShowValidationErrors | Boolean | Parameter |
Style | String | Parameter |
TabIndex | Int16 | Parameter |
ToolTip | String | Parameter |
ValidationGroup | String | Parameter |
Visible | Boolean | Parameter |
Width | String | Parameter |
OnDataBinding | EventHandler | Event |
OnDisposed | EventHandler | Event |
OnInit | EventHandler | Event |
OnLoad | EventHandler | Event |
OnPreRender | EventHandler | Event |
OnUnload | EventHandler | Event |