ValidationSummary.ShowSummary 속성

정의

유효성 검사 요약이 인라인으로 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool ShowSummary { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
public bool ShowSummary { get; set; }
public bool ShowSummary { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.ShowSummary : bool with get, set
member this.ShowSummary : bool with get, set
Public Property ShowSummary As Boolean

속성 값

Boolean

유효성 검사 요약이 인라인으로 표시되는 경우 true이고, 그렇지 않은 경우 false입니다. 기본값은 true입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 ShowMessageBoxShowSummary 모두 메시지 상자에 웹 페이지에서 유효성 검사 요약이 표시 되도록 지정 하는 속성입니다.

중요

이 예제에는 사용자 입력을 허용하는 텍스트 상자가 있으므로 보안상 위험할 수 있습니다. 기본적으로 ASP.NET 웹 페이지는 사용자 입력 내용에 스크립트 또는 HTML 요소가 포함되어 있지 않은지 확인합니다. 자세한 내용은 Script Exploits Overview를 참조하세요.

<%@ Page Language="C#" AutoEventWireup="True" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 <head>
    <title>ValidationSummary Sample</title>
</head>
 <body>
 
    <h3>ValidationSummary Sample</h3>
    <br />
 
    <form id="form1" runat="server">
 
       <table cellpadding="10">
          <tr>
             <td>
                <table style="background-color:#eeeeee; padding:10">
 
                   <tr>
                      <td colspan="3">
                         <b>Credit Card Information</b>
                      </td>
                   </tr>
                   <tr>
                      <td align="right">
                         Card Type:
                      </td>
                      <td>
                         <asp:RadioButtonList id="RadioButtonList1" 
                              RepeatLayout="Flow"
                               runat="server">
                            <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="Static"
                              InitialValue="" Width="100%" runat="server">
                            *
                         </asp:RequiredFieldValidator>
                      </td>
                   </tr>
                   <tr>
                      <td align="right">
                         Card Number:
                      </td>
                      <td>
                         <asp:TextBox id="TextBox1" runat="server" />
                      </td>
                      <td>
                         <asp:RequiredFieldValidator 
                              id="RequiredFieldValidator2"
                              ControlToValidate="TextBox1" 
                              ErrorMessage="Card Number. "
                              Display="Static"
                              Width="100%" runat="server">
                            *
                         </asp:RequiredFieldValidator>
                      </td>
                   </tr>
 
                   <tr>
                      <td></td>
                      <td>
                         <asp:Button 
                              id="Button1" 
                              text="Validate" 
                              runat="server" />
                      </td>
                      <td></td>
                   </tr>
                </table>
             </td>
             <td valign="top">
                <table cellpadding="20">
                   <tr>
                      <td>
                         <asp:ValidationSummary 
                              id="valSum" 
                              DisplayMode="BulletList" 
                              runat="server"
                              ShowSummary="True"
                              HeaderText="You must enter a value in the following fields:"
                              Font-Names="verdana" 
                              Font-Size="12"/>
                      </td>
                   </tr>
                </table>
             </td>
          </tr>
       </table>
 
    </form>
 
 </body>
 </html>
<%@ Page Language="VB" AutoEventWireup="True" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 <head>
    <title>ValidationSummary Sample</title>
</head>
 <body>
 
    <h3>ValidationSummary Sample</h3>
    <br />
 
    <form id="form1" runat="server">
 
       <table cellpadding="10">
          <tr>
             <td>
                <table style="background-color:#eeeeee; padding:10">
 
                   <tr>
                      <td colspan="3">
                         <b>Credit Card Information</b>
                      </td>
                   </tr>
                   <tr>
                      <td align="right">
                         Card Type:
                      </td>
                      <td>
                         <asp:RadioButtonList id="RadioButtonList1" 
                              RepeatLayout="Flow"
                               runat="server">
                            <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="Static"
                              InitialValue="" Width="100%" runat="server">
                            *
                         </asp:RequiredFieldValidator>
                      </td>
                   </tr>
                   <tr>
                      <td align="right">
                         Card Number:
                      </td>
                      <td>
                         <asp:TextBox id="TextBox1" runat="server" />
                      </td>
                      <td>
                         <asp:RequiredFieldValidator 
                              id="RequiredFieldValidator2"
                              ControlToValidate="TextBox1" 
                              ErrorMessage="Card Number. "
                              Display="Static"
                              Width="100%" runat="server">
                            *
                         </asp:RequiredFieldValidator>
                      </td>
                   </tr>
 
                   <tr>
                      <td></td>
                      <td>
                         <asp:Button 
                              id="Button1" 
                              text="Validate" 
                              runat="server" />
                      </td>
                      <td></td>
                   </tr>
                </table>
             </td>
             <td valign="top">
                <table cellpadding="20">
                   <tr>
                      <td>
                         <asp:ValidationSummary 
                              id="valSum" 
                              DisplayMode="BulletList" 
                              runat="server"
                              ShowSummary="True"
                              HeaderText="You must enter a value in the following fields:"
                              Font-Names="verdana" 
                              Font-Size="12"/>
                      </td>
                   </tr>
                </table>
             </td>
          </tr>
       </table>
 
    </form>
 
 </body>
 </html>

설명

이 속성 외에 사용할 수 있습니다는 ShowMessageBox 속성을 컨트롤에서 유효성 검사 요약이 표시 됩니다. 이 속성 설정 된 경우 true, 웹 페이지에 유효성 검사 요약이 표시 됩니다.

참고

모두를 ShowMessageBox 하 고 ShowSummary 속성으로 설정 됩니다 true, 모두 메시지 상자에 웹 페이지에서 유효성 검사 요약이 표시 됩니다.

적용 대상

추가 정보