Repeater Repeater Repeater Repeater Class

定義

藉由對清單中所顯示的每一項目重複指定之樣板的方式,建立可自訂配置的資料繫結 (Data-Bound) 清單控制項。A data-bound list control that allows custom layout by repeating a specified template for each item displayed in the list.

public ref class Repeater : System::Web::UI::Control, System::Web::UI::INamingContainer
public class Repeater : System.Web.UI.Control, System.Web.UI.INamingContainer
type Repeater = class
    inherit Control
    interface INamingContainer
Public Class Repeater
Inherits Control
Implements INamingContainer
繼承
衍生
實作

範例

本主題提供具有原始程式碼的 Visual Studio 網站專案:下載A Visual Studio Web site project with source code is available to accompany this topic: Download.

下列程式碼範例示範如何在頁面上使用Repeater兩個簡單的控制項。The following code example demonstrates how to use two simple Repeater controls on a page. 屬性是用來指定Repeater控制項的資料來源。 DataSourceThe DataSource property is used to specify the data source for the Repeater control. 第一個Repeater會在資料表中顯示其專案,第Repeater二個會在逗號分隔的清單中顯示其專案。The first Repeater displays its items in a table; the second Repeater displays its items in a comma-separated list.

<%@ 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>Repeater Example</title>
<script language="C#" runat="server">
       void Page_Load(Object Sender, EventArgs e) {
          if (!IsPostBack) {
             ArrayList values = new ArrayList();
 
             values.Add(new PositionData("Microsoft", "Msft"));
             values.Add(new PositionData("Intel", "Intc"));
             values.Add(new PositionData("Dell", "Dell"));
 
             Repeater1.DataSource = values;
             Repeater1.DataBind();
                 
             Repeater2.DataSource = values;
             Repeater2.DataBind();
          }
       }
 
       public class PositionData {
         
          private string name;
          private string ticker;
 
          public PositionData(string name, string ticker) {
             this.name = name;
             this.ticker = ticker;
          }
 
          public string Name {
             get {
                return name;
             }
          }
 
          public string Ticker {
             get {
                return ticker;
             }
          }
       }
 
    </script>
 
 </head>
 <body>
 
    <h3>Repeater Example</h3>
 
    <form id="form1" runat="server">
 
       <b>Repeater1:</b>
         
       <br />
         
       <asp:Repeater id="Repeater1" runat="server">
          <HeaderTemplate>
             <table border="1">
                <tr>
                   <td><b>Company</b></td>
                   <td><b>Symbol</b></td>
                </tr>
          </HeaderTemplate>
             
          <ItemTemplate>
             <tr>
                <td> <%# DataBinder.Eval(Container.DataItem, "Name") %> </td>
                <td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
             </tr>
          </ItemTemplate>
             
          <FooterTemplate>
             </table>
          </FooterTemplate>
             
       </asp:Repeater>
       <br />
         
       <b>Repeater2:</b>
       <br />
       <asp:Repeater id="Repeater2" runat="server">
         
          <HeaderTemplate>
             Company data:
          </HeaderTemplate>
             
          <ItemTemplate>
             <%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
          </ItemTemplate>
             
          <SeparatorTemplate>, </SeparatorTemplate>
       </asp:Repeater>
    </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>Repeater Example</title>
<script language="VB" runat="server">

    Sub Page_Load(Sender As Object, e As EventArgs)
        If Not IsPostBack Then
            Dim values As New ArrayList()
            
            values.Add(New PositionData("Microsoft", "Msft"))
            values.Add(New PositionData("Intel", "Intc"))
            values.Add(New PositionData("Dell", "Dell"))
            
            Repeater1.DataSource = values
            Repeater1.DataBind()
            
            Repeater2.DataSource = values
            Repeater2.DataBind()
        End If
    End Sub

    Public Class PositionData
        
        Private myName As String
        Private myTicker As String        
        
        Public Sub New(newName As String, newTicker As String)
            Me.myName = newName
            Me.myTicker = newTicker
        End Sub        
        
        Public ReadOnly Property Name() As String
            Get
                Return myName
            End Get
        End Property        
        
        Public ReadOnly Property Ticker() As String
            Get
                Return myTicker
            End Get
        End Property
    End Class
 
    </script>
 
 </head>
 <body>
 
    <h3>Repeater Example</h3>
 
    <form id="form1" runat="server">
 
       <b>Repeater1:</b>
         
       <br />
         
       <asp:Repeater id="Repeater1" runat="server">
          <HeaderTemplate>
             <table border="1">
                <tr>
                   <td><b>Company</b></td>
                   <td><b>Symbol</b></td>
                </tr>
          </HeaderTemplate>
             
          <ItemTemplate>
             <tr>
                <td> <%# DataBinder.Eval(Container.DataItem, "Name") %> </td>
                <td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
             </tr>
          </ItemTemplate>
             
          <FooterTemplate>
             </table>
          </FooterTemplate>
             
       </asp:Repeater>
       <br />
         
       <b>Repeater2:</b>
       <br />
       <asp:Repeater id="Repeater2" runat="server">
         
          <HeaderTemplate>
             Company data:
          </HeaderTemplate>
             
          <ItemTemplate>
             <%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
          </ItemTemplate>
             
          <SeparatorTemplate>, </SeparatorTemplate>
       </asp:Repeater>
    </form>
 </body>
 </html>
 

下列程式碼範例示範如何使用DataSourceID屬性來指定Repeater控制項的資料來源。The following code example demonstrates how to use the DataSourceID property to specify the data source for a Repeater control. 屬性會設定ID為用來抓取資料之SqlDataSource控制項的屬性。 DataSourceIDThe DataSourceID property is set to the ID property of the SqlDataSource control used to retrieve the data. 載入頁面時, Repeater控制項會自動系結至SqlDataSource控制項所指定的資料來源,並向使用者顯示資料。When the page is loaded, the Repeater control automatically binds to the data source specified by the SqlDataSource control and the data is displayed to the user.

<%@ page language="C#" %>

<!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>Repeater.DataSourceID Property Example</title>
</head>

  <body>
    <form id="Form1" runat="server">
        
      <h3>Repeater.DataSourceID Property Example</h3>
      
      <asp:repeater id="Repeater1"       
        datasourceid="SqlDataSource1"
        runat="server">
        
        <headertemplate>
          <table border="1">
            <tr>
              <td><b>Product ID</b></td>
              <td><b>Product Name</b></td>
            </tr>
        </headertemplate>
          
        <itemtemplate>
          <tr>
            <td> <%# Eval("ProductID") %> </td>
            <td> <%# Eval("ProductName") %> </td>
          </tr>
        </itemtemplate>
          
        <footertemplate>
          </table>
        </footertemplate>
      </asp:repeater>
        
            <asp:sqldatasource id="SqlDataSource1"          
            connectionstring="<%$ ConnectionStrings:NorthWindConnection%>" 
        selectcommand="SELECT ProductID, ProductName FROM [Products] Where ProductID <= 10"
        runat="server">
      </asp:sqldatasource>
               
    </form>      
  </body>
</html>
<%@ Page Language="VB" %>

<!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>Repeater.DataSourceID Property Example</title>
</head>

  <body>
    <form id="Form1" runat="server">
        
      <h3>Repeater.DataSourceID Property Example</h3>
      
      <asp:repeater id="Repeater1"       
        datasourceid="SqlDataSource1"
        runat="server">
        
        <headertemplate>
          <table border="1">
            <tr>
              <td><b>Product ID</b></td>
              <td><b>Product Name</b></td>
            </tr>
        </headertemplate>
          
        <itemtemplate>
          <tr>
            <td> <%# Eval("ProductID") %> </td>
            <td> <%# Eval("ProductName") %> </td>
          </tr>
        </itemtemplate>
          
        <footertemplate>
          </table>
        </footertemplate>
      </asp:repeater>
        
            <asp:sqldatasource id="SqlDataSource1"          
            connectionstring="<%$ ConnectionStrings:NorthWindConnection%>" 
        selectcommand="SELECT ProductID, ProductName FROM [Products] Where ProductID <= 10"
        runat="server">
      </asp:sqldatasource>
               
    </form>      
  </body>
</html>

備註

本主題內容:In this topic:

簡介Introduction

Repeater控制項是基本的樣板化資料系結清單。The Repeater control is a basic templated data-bound list. 它沒有內建的版面配置或樣式,因此您必須在控制項的範本中明確宣告所有版面配置、格式和樣式標記。It has no built-in layout or styles, so you must explicitly declare all layout, formatting, and style tags within the control's templates.

Repeater控制項可讓您跨範本分割標記標記。The Repeater control allows you to split markup tags across the templates. 若要使用範本來建立資料表,請在中包含開始<table>資料表標記( HeaderTemplate)、中的單一資料表資料<tr>ItemTemplate標記(),以及中FooterTemplate的結束資料表</table>標記()。To create a table using templates, include the begin table tag (<table>) in the HeaderTemplate, a single table row tag (<tr>) in the ItemTemplate, and the end table tag (</table>) in the FooterTemplate.

Repeater控制項沒有內建的選取功能或編輯支援。The Repeater control has no built-in selection capabilities or editing support. 您可以使用ItemCommand事件來處理從範本引發至控制項的控制項事件。You can use the ItemCommand event to process control events that are raised from the templates to the control.

警告

這個控制項可以用來顯示使用者輸入,其中可能包含惡意的用戶端腳本。This control can be used to display user input, which might include malicious client script. 在應用程式中顯示之前,檢查是否有任何從用戶端針對可執行檔腳本、SQL 語句或其他程式碼傳送的資訊。Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET 提供輸入要求驗證功能,以封鎖使用者輸入中的腳本和 HTML。ASP.NET provides an input request validation feature to block script and HTML in user input. 也會提供驗證服務器控制項來評估使用者輸入。Validation server controls are also provided to assess user input. 如需詳細資訊,請參閱驗證服務器控制項語法For more information, see Validation Server Control Syntax.

資料繫結Data Binding

Repeater控制項提供兩個屬性來支援資料系結。The Repeater control provides two properties to support data binding. 若要將資料系結至任何執行System.Collections.IEnumerable介面的集合(例如System.Data.DataViewSystem.Collections.ArrayList、或陣列DataSource )或IListSource介面,請使用屬性來指定資料來源。To bind data to any collection that implements the System.Collections.IEnumerable interface (such as a System.Data.DataView, a System.Collections.ArrayList, or an array), or the IListSource interface, use the DataSource property to specify the data source. 當您設定DataSource屬性時,您必須手動撰寫程式碼來執行資料系結。When you set the DataSource property, you must manually write the code to perform data binding. 若要自動Repeater將控制項系結至資料來源控制項所代表的資料來源,請DataSourceID將屬性設定ID為要使用之資料來源控制項的。To automatically bind the Repeater control to a data source represented by a data source control, set the DataSourceID property to the ID of the data source control to use. 當您設定DataSourceID屬性時Repeater ,控制項會自動系結至第一個要求上指定的資料來源控制項。When you set the DataSourceID property, the Repeater control automatically binds to the specified data source control on the first request. 因此,除非您已變更DataBind Repeater控制項的資料相關屬性,否則不需要明確地呼叫方法。Therefore, you do not need to explicitly call the DataBind method unless you have changed data-related properties of the Repeater control.

ItemTemplate DataSource控制項會將其DataSourceIDAlternatingItemTemplate系結至其屬性所宣告和參考的資料模型,或是其屬性所指定的資料來源控制項。 RepeaterA Repeater control binds its ItemTemplate and AlternatingItemTemplate to either the data model declared and referenced by its DataSource property or the data source control specified by its DataSourceID property. HeaderTemplate、和不SeparatorTemplate是資料系結。 FooterTemplateThe HeaderTemplate, FooterTemplate, and SeparatorTemplate are not data-bound.

如果已設定HeaderTemplate FooterTemplate控制項的資料來源,但未傳回任何資料,則控制項會呈現不含任何專案的和。 RepeaterIf the Repeater control's data source is set but no data is returned, the control renders the HeaderTemplate and FooterTemplate with no items. 如果資料來源為null Repeater ,則不會呈現。If the data source is null, the Repeater is not rendered.

範本Templates

每個Repeater控制項至少必須ItemTemplate定義。At a minimum, every Repeater control must define an ItemTemplate. 不過,下表所描述的其他選擇性範本可以用來自訂清單的外觀。However, other optional templates described in the following table can be used to customize the appearance of the list.

範本名稱Template name 說明Description
ItemTemplate 定義清單中專案的內容和版面配置。Defines the content and layout of items within the list. 這是必要的範本。This template is required.
AlternatingItemTemplate 若已定義,會決定交替(以零為基底的奇數索引)專案的內容和版面配置。If defined, determines the content and layout of alternating (zero-based odd-indexed) items. 如果未定義, ItemTemplate則會使用。If not defined, ItemTemplate is used.
SeparatorTemplate 如果已定義,則會在專案(和替代專案)之間呈現。If defined, is rendered between items (and alternating items). 如果未定義,則不會呈現分隔符號。If not defined, a separator is not rendered.
HeaderTemplate 若已定義,會決定清單標頭的內容和版面配置。If defined, determines the content and layout of the list header. 如果未定義,則不會呈現標頭。If not defined, a header is not rendered.
FooterTemplate 若已定義,會決定清單頁尾的內容和版面配置。If defined, determines the content and layout of the list footer. 如果未定義,則不會呈現頁尾。If not defined, a footer is not rendered.

宣告式語法Declarative Syntax

<asp:Repeater  
    DataMember="string"  
    DataSource="string"  
    DataSourceID="string"  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    ID="string"  
    OnDataBinding="DataBinding event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnItemCommand="ItemCommand event handler"  
    OnItemCreated="ItemCreated event handler"  
    OnItemDataBound="ItemDataBound event handler"  
    OnLoad="Load event handler"  
    OnPreRender="PreRender event handler"  
    OnUnload="Unload event handler"  
    runat="server"  
    Visible="True|False"  
>  
        <AlternatingItemTemplate>  
            <!-- child controls -->  
        </AlternatingItemTemplate>  
        <FooterTemplate>  
            <!-- child controls -->  
        </FooterTemplate>  
        <HeaderTemplate>  
            <!-- child controls -->  
        </HeaderTemplate>  
        <ItemTemplate>  
            <!-- child controls -->  
        </ItemTemplate>  
        <SeparatorTemplate>  
            <!-- child controls -->  
        </SeparatorTemplate>  
</asp:Repeater>  

建構函式

Repeater() Repeater() Repeater() Repeater()

初始化 Repeater 類別的新執行個體。Initializes a new instance of the Repeater class.

屬性

Adapter Adapter Adapter Adapter

針對控制項取得瀏覽器的特定配置器。Gets the browser-specific adapter for the control.

(Inherited from Control)
AlternatingItemTemplate AlternatingItemTemplate AlternatingItemTemplate AlternatingItemTemplate

取得或設定實作 ITemplate 的物件,其定義如何顯示控制項中的替代項目。Gets or sets the object implementing ITemplate that defines how alternating items in the control are displayed.

AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory

取得或設定包含了此控制項之 PageUserControl 物件的相對應用程式虛擬目錄。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(Inherited from Control)
BindingContainer BindingContainer BindingContainer BindingContainer

取得包含了此控制項之資料繫結的控制項。Gets the control that contains this control's data binding.

(Inherited from Control)
ChildControlsCreated ChildControlsCreated ChildControlsCreated ChildControlsCreated

取得值,指出是否已經建立伺服器控制項的子控制項。Gets a value that indicates whether the server control's child controls have been created.

(Inherited from Control)
ClientID ClientID ClientID ClientID

取得 ASP.NET 所產生之 HTML 標記的控制項識別碼。Gets the control ID for HTML markup that is generated by ASP.NET.

(Inherited from Control)
ClientIDMode ClientIDMode ClientIDMode ClientIDMode

取得或設定用來產生 ClientID 屬性值的演算法。Gets or sets the algorithm that is used to generate the value of the ClientID property.

(Inherited from Control)
ClientIDSeparator ClientIDSeparator ClientIDSeparator ClientIDSeparator

取得字元值,表示在 ClientID 屬性中所使用的分隔字元。Gets a character value representing the separator character used in the ClientID property.

(Inherited from Control)
Context Context Context Context

取得與目前 Web 要求的伺服器控制項關聯的 HttpContext 物件。Gets the HttpContext object associated with the server control for the current Web request.

(Inherited from Control)
Controls Controls Controls Controls

取得 ControlCollection,其中包含 Repeater 控制項的子控制項。Gets a ControlCollection that contains the child controls of the Repeater control.

DataItemContainer DataItemContainer DataItemContainer DataItemContainer

如果命名容器實作 IDataItemContainer,則取得命名容器的參考。Gets a reference to the naming container if the naming container implements IDataItemContainer.

(Inherited from Control)
DataKeysContainer DataKeysContainer DataKeysContainer DataKeysContainer

如果命名容器實作 IDataKeysControl,則取得命名容器的參考。Gets a reference to the naming container if the naming container implements IDataKeysControl.

(Inherited from Control)
DataMember DataMember DataMember DataMember

取得或設定 DataSource 中要繫結至控制項的特定表格。Gets or sets the specific table in the DataSource to bind to the control.

DataSource DataSource DataSource DataSource

取得或設定提供資料以填入 (Populate) 清單的資料來源。Gets or sets the data source that provides data for populating the list.

DataSourceID DataSourceID DataSourceID DataSourceID

取得或設定資料來源控制項的 ID 屬性,而 Repeater 控制項應該用這個控制項來擷取其資料來源。Gets or sets the ID property of the data source control that the Repeater control should use to retrieve its data source.

DesignMode DesignMode DesignMode DesignMode

取得值,指出控制項是否正用於設計介面上。Gets a value indicating whether a control is being used on a design surface.

(Inherited from Control)
EnableTheming EnableTheming EnableTheming EnableTheming

取得或設定值,指出主題是否套用至此控制項。Gets or sets a value indicating whether themes are applied to this control.

EnableViewState EnableViewState EnableViewState EnableViewState

取得或設定值,該值表示伺服器控制項是否對要求的用戶端而言保持其檢視狀態,以及它包含的任何子控制項狀態。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(Inherited from Control)
Events Events Events Events

取得控制項事件處理常式委派 (Delegate) 的清單。Gets a list of event handler delegates for the control. 這個屬性是唯讀的。This property is read-only.

(Inherited from Control)
FooterTemplate FooterTemplate FooterTemplate FooterTemplate

取得或設定 ITemplate,其定義 Repeater 控制項頁尾區段的顯示方式。Gets or sets the ITemplate that defines how the footer section of the Repeater control is displayed.

HasChildViewState HasChildViewState HasChildViewState HasChildViewState

取得值,指出目前伺服器控制項的子控制項是否有任何已儲存的檢視狀態設定。Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(Inherited from Control)
HeaderTemplate HeaderTemplate HeaderTemplate HeaderTemplate

取得或設定 ITemplate,其定義 Repeater 控制項頁首區段的顯示方式。Gets or sets the ITemplate that defines how the header section of the Repeater control is displayed.

IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder

如需這個成員的說明,請參閱 ControlBuilderFor a description of this member, see ControlBuilder.

(Inherited from Control)
IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData

如需這個成員的說明,請參閱 UserDataFor a description of this member, see UserData.

(Inherited from Control)
ID ID ID ID

取得或設定指派給伺服器控制項的程式設計識別項。Gets or sets the programmatic identifier assigned to the server control.

(Inherited from Control)
IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings

如需這個成員的說明,請參閱 DataBindingsFor a description of this member, see DataBindings.

(Inherited from Control)
IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings

如需這個成員的說明,請參閱 HasDataBindingsFor a description of this member, see HasDataBindings.

(Inherited from Control)
IdSeparator IdSeparator IdSeparator IdSeparator

取得用來分隔控制項識別項的字元。Gets the character used to separate control identifiers.

(Inherited from Control)
IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions

如需這個成員的說明,請參閱 ExpressionsFor a description of this member, see Expressions.

(Inherited from Control)
IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions

如需這個成員的說明,請參閱 HasExpressionsFor a description of this member, see HasExpressions.

(Inherited from Control)
Initialized Initialized Initialized Initialized

傳回值,指出是否已初始化控制項。Returns a value indicating whether the control has been initialized.

IsBoundUsingDataSourceID IsBoundUsingDataSourceID IsBoundUsingDataSourceID IsBoundUsingDataSourceID

取得值,指出是否已設定 DataSourceID 屬性。Gets a value indicating whether the DataSourceID property is set.

IsChildControlStateCleared IsChildControlStateCleared IsChildControlStateCleared IsChildControlStateCleared

取得值,指出這個控制項中所包含的控制項是否有控制項狀態。Gets a value indicating whether controls contained within this control have control state.

(Inherited from Control)
IsDataBindingAutomatic IsDataBindingAutomatic IsDataBindingAutomatic IsDataBindingAutomatic

取得值,指出資料繫結是否為自動。Gets a value that indicates whether data binding is automatic.

IsTrackingViewState IsTrackingViewState IsTrackingViewState IsTrackingViewState

取得值,指出伺服器控制項是否正在儲存檢視狀態的變更。Gets a value that indicates whether the server control is saving changes to its view state.

(Inherited from Control)
IsViewStateEnabled IsViewStateEnabled IsViewStateEnabled IsViewStateEnabled

取得值,指出這個控制項是否已啟用檢視狀態。Gets a value indicating whether view state is enabled for this control.

(Inherited from Control)
Items Items Items Items

取得 RepeaterItem 控制項中 Repeater 物件的集合。Gets a collection of RepeaterItem objects in the Repeater control.

ItemTemplate ItemTemplate ItemTemplate ItemTemplate

取得或設定 ITemplate,其定義 Repeater 控制項中項目的顯示方式。Gets or sets the ITemplate that defines how items in the Repeater control are displayed.

ItemType ItemType ItemType ItemType

強型別資料繫結的模型型別的名稱。The name of the model type for strongly typed data binding.

LoadViewStateByID LoadViewStateByID LoadViewStateByID LoadViewStateByID

取得值,指出控制項是否依 ID (而不是索引) 參與載入其檢視狀態。Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(Inherited from Control)
NamingContainer NamingContainer NamingContainer NamingContainer

取得伺服器控制項命名容器的參考,其建立唯一命名空間,在具有相同 ID 屬性值的伺服器控制項之間作區別。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(Inherited from Control)
Page Page Page Page

取得含有伺服器控制項的 Page 執行個體的參考。Gets a reference to the Page instance that contains the server control.

(Inherited from Control)
Parent Parent Parent Parent

在網頁控制階層架構中取得伺服器控制項之父控制項的參考。Gets a reference to the server control's parent control in the page control hierarchy.

(Inherited from Control)
RenderingCompatibility RenderingCompatibility RenderingCompatibility RenderingCompatibility

取得值,這個值會指定將與呈現 HTML 相容的 ASP.NET 版本。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(Inherited from Control)
RequiresDataBinding RequiresDataBinding RequiresDataBinding RequiresDataBinding

取得或設定值,指出 Repeater 控制項是否需要繫結至其指定的資料來源。Gets or sets a value indicating whether the Repeater control needs to bind to its specified data source.

SelectArguments SelectArguments SelectArguments SelectArguments

取得 DataSourceSelectArguments 物件,當從資料來源控制項擷取資料時 Repeater 控制項會使用它。Gets a DataSourceSelectArguments object that the Repeater control uses when retrieving data from a data source control.

SelectMethod SelectMethod SelectMethod SelectMethod

為了讀取資料要呼叫的方法的名稱。The name of the method to call in order to read data.

SeparatorTemplate SeparatorTemplate SeparatorTemplate SeparatorTemplate

取得或設定 ITemplate 介面,其會定義項目間分隔符號的顯示方式。Gets or sets the ITemplate interface that defines how the separator between items is displayed.

Site Site Site Site

當呈現在設計介面上時,取得裝載目前控制項之容器的資訊。Gets information about the container that hosts the current control when rendered on a design surface.

(Inherited from Control)
SkinID SkinID SkinID SkinID

取得或設定要套用至控制項的面板。Gets or sets the skin to apply to the control.

(Inherited from Control)
TemplateControl TemplateControl TemplateControl TemplateControl

取得或設定包含了此控制項之樣板的參考。Gets or sets a reference to the template that contains this control.

(Inherited from Control)
TemplateSourceDirectory TemplateSourceDirectory TemplateSourceDirectory TemplateSourceDirectory

取得包含目前伺服器控制項的 PageUserControl 的虛擬目錄。Gets the virtual directory of the Page or UserControl that contains the current server control.

(Inherited from Control)
UniqueID UniqueID UniqueID UniqueID

取得伺服器控制項唯一的、符合階層架構的識別項。Gets the unique, hierarchically qualified identifier for the server control.

(Inherited from Control)
ValidateRequestMode ValidateRequestMode ValidateRequestMode ValidateRequestMode

取得或設定值,指出控制項是否對來自瀏覽器的用戶端輸入檢查潛在的危險值。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(Inherited from Control)
ViewState ViewState ViewState ViewState

取得狀態資訊的字典,允許您在相同網頁的多個要求之間,儲存和還原伺服器控制項的檢視狀態。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(Inherited from Control)
ViewStateIgnoresCase ViewStateIgnoresCase ViewStateIgnoresCase ViewStateIgnoresCase

取得值,指出 StateBag 物件是否不區分大小寫。Gets a value that indicates whether the StateBag object is case-insensitive.

(Inherited from Control)
ViewStateMode ViewStateMode ViewStateMode ViewStateMode

取得或設定這個控制項的檢視狀態模式。Gets or sets the view-state mode of this control.

(Inherited from Control)
Visible Visible Visible Visible

取得或設定值,指出伺服器控制項是否會轉譯為頁面上的 UI。Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(Inherited from Control)

方法

AddedControl(Control, Int32) AddedControl(Control, Int32) AddedControl(Control, Int32) AddedControl(Control, Int32)

在子控制項加入 Control 物件的 Controls 集合後呼叫。Called after a child control is added to the Controls collection of the Control object.

(Inherited from Control)
AddParsedSubObject(Object) AddParsedSubObject(Object) AddParsedSubObject(Object) AddParsedSubObject(Object)

通知伺服器控制項,XML 或 HTML 項目已剖析,並將項目加入伺服器控制項的 ControlCollection 物件中。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(Inherited from Control)
ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page)

將頁面樣式表中所定義的樣式屬性套用至控制項。Applies the style properties defined in the page style sheet to the control.

(Inherited from Control)
BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object)

開始進行轉譯資料的設計階段追蹤。Begins design-time tracing of rendering data.

(Inherited from Control)
BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean)

收集伺服器控制項的相關資訊,並在頁面啟用追蹤時將此資訊傳遞至 Trace 屬性以顯示之。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(Inherited from Control)
ClearCachedClientID() ClearCachedClientID() ClearCachedClientID() ClearCachedClientID()

將快取的 ClientID 值設定為 nullSets the cached ClientID value to null.

(Inherited from Control)
ClearChildControlState() ClearChildControlState() ClearChildControlState() ClearChildControlState()

刪除伺服器控制項之子控制項的控制項狀態資訊。Deletes the control-state information for the server control's child controls.

(Inherited from Control)
ClearChildState() ClearChildState() ClearChildState() ClearChildState()

刪除所有伺服器控制項之子控制項的檢視狀態和控制項狀態資訊。Deletes the view-state and control-state information for all the server control's child controls.

(Inherited from Control)
ClearChildViewState() ClearChildViewState() ClearChildViewState() ClearChildViewState()

刪除所有伺服器控制項之子控制項的檢視狀態資訊。Deletes the view-state information for all the server control's child controls.

(Inherited from Control)
ClearEffectiveClientIDMode() ClearEffectiveClientIDMode() ClearEffectiveClientIDMode() ClearEffectiveClientIDMode()

將目前的控制項執行個體和任何子控制項的 ClientIDMode 屬性設定為 InheritSets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(Inherited from Control)
CreateChildControls() CreateChildControls() CreateChildControls() CreateChildControls()

由 ASP.NET 網頁架構呼叫,通知使用組合實作的伺服器控制項來建立所包含的任何子控制項,以準備回傳或呈現。Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

CreateControlCollection() CreateControlCollection() CreateControlCollection() CreateControlCollection()

建立新的 ControlCollection 物件來保存伺服器控制項的子控制項 (常值和伺服器)。Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control.

(Inherited from Control)
CreateControlHierarchy(Boolean) CreateControlHierarchy(Boolean) CreateControlHierarchy(Boolean) CreateControlHierarchy(Boolean)

使用或不使用指定的資料來源建立控制項階層架構。Creates a control hierarchy, with or without the specified data source.

CreateDataSourceSelectArguments() CreateDataSourceSelectArguments() CreateDataSourceSelectArguments() CreateDataSourceSelectArguments()

傳回 Empty 值。Returns the Empty value.

CreateItem(Int32, ListItemType) CreateItem(Int32, ListItemType) CreateItem(Int32, ListItemType) CreateItem(Int32, ListItemType)

使用 RepeaterItem 控制項內的指定項目類型和位置,建立 Repeater 物件。Creates a RepeaterItem object with the specified item type and location within the Repeater control.

DataBind() DataBind() DataBind() DataBind()

Repeater 控制項和它的所有子控制項繫結至指定的資料來源。Binds the Repeater control and all its child controls to the specified data source.

DataBind(Boolean) DataBind(Boolean) DataBind(Boolean) DataBind(Boolean)

使用會引發 DataBinding 事件的選項,繫結資料來源至叫用的伺服器控制項及其所有子控制項。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(Inherited from Control)
DataBindChildren() DataBindChildren() DataBindChildren() DataBindChildren()

繫結資料來源至伺服器控制項的子控制項。Binds a data source to the server control's child controls.

(Inherited from Control)
Dispose() Dispose() Dispose() Dispose()

啟用伺服器控制項,在它從記憶體釋放之前執行最後清除。Enables a server control to perform final clean up before it is released from memory.

(Inherited from Control)
EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object)

結束轉譯資料的設計階段追蹤。Ends design-time tracing of rendering data.

(Inherited from Control)
EnsureChildControls() EnsureChildControls() EnsureChildControls() EnsureChildControls()

判斷伺服器控制項是否包含子控制項。Determines whether the server control contains child controls. 如果不包含,則建立子控制項。If it does not, it creates child controls.

(Inherited from Control)
EnsureDataBound() EnsureDataBound() EnsureDataBound() EnsureDataBound()

呼叫 Repeater 方法之前,請先確認 DataBind() 控制項是否需要資料繫結,而且是否已指定有效的資料來源。Verifies that the Repeater control requires data binding and that a valid data source control is specified before calling the DataBind() method.

EnsureID() EnsureID() EnsureID() EnsureID()

為尚未指定識別項的控制項,建立識別項。Creates an identifier for controls that do not have an identifier assigned.

(Inherited from Control)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindControl(String) FindControl(String) FindControl(String) FindControl(String)

在目前命名容器搜尋具有指定 id 參數的伺服器控制項。Searches the current naming container for a server control with the specified id parameter.

(Inherited from Control)
FindControl(String, Int32) FindControl(String, Int32) FindControl(String, Int32) FindControl(String, Int32)

使用指定的 id 和有助於搜尋之 pathOffset 參數中所指定的整數,在目前的命名容器中搜尋伺服器控制項。Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. 您不應該覆寫這個版本的 FindControl 方法。You should not override this version of the FindControl method.

(Inherited from Control)
Focus() Focus() Focus() Focus()

設定控制項的輸入焦點。Sets input focus to a control.

(Inherited from Control)
GetData() GetData() GetData() GetData()

傳回資料來源中的 IEnumerable 介面。Returns an IEnumerable interface from the data source.

GetDesignModeState() GetDesignModeState() GetDesignModeState() GetDesignModeState()

取得控制項的設計階段資料。Gets design-time data for a control.

(Inherited from Control)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetRouteUrl(Object) GetRouteUrl(Object) GetRouteUrl(Object) GetRouteUrl(Object)

取得會對應於一組路由參數的 URL。Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary)

取得會對應於一組路由參數的 URL。Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(String, Object) GetRouteUrl(String, Object) GetRouteUrl(String, Object) GetRouteUrl(String, Object)

取得 URL,此 URL 對應於一組路由參數及一個路由名稱。Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary)

取得 URL,此 URL 對應於一組路由參數及一個路由名稱。Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control)

傳回指定之控制項 UniqueID 屬性的前置部分。Returns the prefixed portion of the UniqueID property of the specified control.

(Inherited from Control)
HasControls() HasControls() HasControls() HasControls()

判斷伺服器控制項是否包含任何子控制項。Determines if the server control contains any child controls.

(Inherited from Control)
HasEvents() HasEvents() HasEvents() HasEvents()

傳回值,指出控制項或任何子控制項的事件是否已註冊。Returns a value indicating whether events are registered for the control or any child controls.

(Inherited from Control)
InitializeItem(RepeaterItem) InitializeItem(RepeaterItem) InitializeItem(RepeaterItem) InitializeItem(RepeaterItem)

以子控制項的子階層架構重複填入指定的 RepeaterItemPopulates iteratively the specified RepeaterItem with a sub-hierarchy of child controls.

IsLiteralContent() IsLiteralContent() IsLiteralContent() IsLiteralContent()

判斷伺服器控制項是否只儲存常值內容。Determines if the server control holds only literal content.

(Inherited from Control)
LoadControlState(Object) LoadControlState(Object) LoadControlState(Object) LoadControlState(Object)

SaveControlState() 方法所儲存的上一頁要求中,還原控制項狀態資訊。Restores control-state information from a previous page request that was saved by the SaveControlState() method.

(Inherited from Control)
LoadViewState(Object) LoadViewState(Object) LoadViewState(Object) LoadViewState(Object)

還原先前使用 SaveViewState() 方法所儲存的上一個網頁要求中的檢視-狀態資訊。Restores view-state information from a previous page request that was saved using the SaveViewState() method.

MapPathSecure(String) MapPathSecure(String) MapPathSecure(String) MapPathSecure(String)

擷取虛擬絕對路徑或相對路徑所對應至的實體路徑。Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(Inherited from Control)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs)

如果 EventArgs 參數為 ItemCommand 的執行個體,則會引發 RepeaterCommandEventArgs 事件。Raises the ItemCommand event if the EventArgs parameter is an instance of RepeaterCommandEventArgs.

OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)

引發 CreatingModelDataSource 事件。Raises the CreatingModelDataSource event.

OnDataBinding(EventArgs) OnDataBinding(EventArgs) OnDataBinding(EventArgs) OnDataBinding(EventArgs)

引發 DataBinding 事件。Raises the DataBinding event.

OnDataPropertyChanged() OnDataPropertyChanged() OnDataPropertyChanged() OnDataPropertyChanged()

判斷是否需要資料繫結。Determines whether data binding is required.

OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs)

RequiresDataBinding 屬性設定為 trueSets the RequiresDataBinding property to true.

OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs)

引發 Init 事件。Raises the Init event.

OnItemCommand(RepeaterCommandEventArgs) OnItemCommand(RepeaterCommandEventArgs) OnItemCommand(RepeaterCommandEventArgs) OnItemCommand(RepeaterCommandEventArgs)

引發 ItemCommand 事件。Raises the ItemCommand event.

OnItemCreated(RepeaterItemEventArgs) OnItemCreated(RepeaterItemEventArgs) OnItemCreated(RepeaterItemEventArgs) OnItemCreated(RepeaterItemEventArgs)

引發 ItemCreated 事件。Raises the ItemCreated event.

OnItemDataBound(RepeaterItemEventArgs) OnItemDataBound(RepeaterItemEventArgs) OnItemDataBound(RepeaterItemEventArgs) OnItemDataBound(RepeaterItemEventArgs)

引發 ItemDataBound 事件。Raises the ItemDataBound event.

OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs)

引發 Load 事件或執行其他初始化。Raises the Load event and performs other initialization.

OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs)

引發 PreRender 事件。Raises the PreRender event.

OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs)

引發 Unload 事件。Raises the Unload event.

(Inherited from Control)
OpenFile(String) OpenFile(String) OpenFile(String) OpenFile(String)

取得用來讀取檔案的 StreamGets a Stream used to read a file.

(Inherited from Control)
RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs)

指派事件的任何來源和它的資訊至控制項的父控制項。Assigns any sources of the event and its information to the control's parent.

(Inherited from Control)
RemovedControl(Control) RemovedControl(Control) RemovedControl(Control) RemovedControl(Control)

Control 物件的 Controls 集合中移除子控制項之後呼叫。Called after a child control is removed from the Controls collection of the Control object.

(Inherited from Control)
Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter)

將伺服器控制項內容傳送到提供的 HtmlTextWriter 物件,以寫入要在用戶端上呈現的內容。Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(Inherited from Control)
RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter)

輸出伺服器控制項之子控制項的內容至提供的 HtmlTextWriter 物件,這個物件會寫入用戶端上所要呈現的內容。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(Inherited from Control)
RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter)

將伺服器控制項內容輸出至提供的 HtmlTextWriter 物件,並在啟用追蹤時儲存控制項的追蹤資訊。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(Inherited from Control)
RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的 HtmlTextWriter 物件,輸出伺服器控制項內容至提供的 ControlAdapter 物件。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(Inherited from Control)
ResolveAdapter() ResolveAdapter() ResolveAdapter() ResolveAdapter()

取得負責呈現指定之控制項的控制項配置器。Gets the control adapter responsible for rendering the specified control.

(Inherited from Control)
ResolveClientUrl(String) ResolveClientUrl(String) ResolveClientUrl(String) ResolveClientUrl(String)

取得瀏覽器可使用的 URL。Gets a URL that can be used by the browser.

(Inherited from Control)
ResolveUrl(String) ResolveUrl(String) ResolveUrl(String) ResolveUrl(String)

將 URL 轉換為要求用戶端可使用的 URL。Converts a URL into one that is usable on the requesting client.

(Inherited from Control)
SaveControlState() SaveControlState() SaveControlState() SaveControlState()

儲存頁面回傳至伺服器以來,所發生的任何伺服器控制項狀態變更。Saves any server control state changes that have occurred since the time the page was posted back to the server.

(Inherited from Control)
SaveViewState() SaveViewState() SaveViewState() SaveViewState()

儲存自從網頁回傳至伺服器以來所發生的任何檢視狀態變更。Saves any view-state changes that have occurred since the time the page was posted back to the server.

SetDesignModeState(IDictionary) SetDesignModeState(IDictionary) SetDesignModeState(IDictionary) SetDesignModeState(IDictionary)

設定控制項的設計階段資料。Sets design-time data for a control.

(Inherited from Control)
SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod)

指定事件處理常式委派,以呈現伺服器控制項及其內容至其父控制項。Assigns an event handler delegate to render the server control and its content into its parent control.

(Inherited from Control)
SetTraceData(Object, Object) SetTraceData(Object, Object) SetTraceData(Object, Object) SetTraceData(Object, Object)

使用追蹤資料機碼和追蹤資料值,設定設計階段期間追蹤呈現資料的追蹤資料。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(Inherited from Control)
SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object)

使用追蹤的物體、追蹤資料機碼和追蹤資料值,設定設計階段期間追蹤呈現資料的追蹤資料。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(Inherited from Control)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TrackViewState() TrackViewState() TrackViewState() TrackViewState()

導致對控制項的檢視狀態變更的追蹤 (Tracking),以便它們能夠儲存於控制項的 StateBag 物件。Causes tracking of view-state changes to the control so they can be stored in the control's StateBag object.

事件

CallingDataMethods CallingDataMethods CallingDataMethods CallingDataMethods

正在呼叫資料方法時發生。Occurs when data methods are being called.

CreatingModelDataSource CreatingModelDataSource CreatingModelDataSource CreatingModelDataSource

正在建立 ModelDataSource 物件時發生。Occurs when the ModelDataSource object is being created.

DataBinding DataBinding DataBinding DataBinding

發生於伺服器控制項繫結至資料來源時。Occurs when the server control binds to a data source.

(Inherited from Control)
Disposed Disposed Disposed Disposed

發生於伺服器控制項從記憶體釋放時,這是在要求 ASP.NET 網頁時,伺服器控制項生命週期的最後階段。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(Inherited from Control)
Init Init Init Init

發生於初始化伺服器控制項時,是其生命週期中的第一個步驟。Occurs when the server control is initialized, which is the first step in its lifecycle.

(Inherited from Control)
ItemCommand ItemCommand ItemCommand ItemCommand

按一下 Repeater 控制項中的按鈕時會發生這個事件。Occurs when a button is clicked in the Repeater control.

ItemCreated ItemCreated ItemCreated ItemCreated

當在 Repeater 控制項中建立項目時發生。Occurs when an item is created in the Repeater control.

ItemDataBound ItemDataBound ItemDataBound ItemDataBound

發生於 Repeater 控制項中的項目進行資料繫結之後,但未呈現在頁面上時。Occurs after an item in the Repeater control is data-bound but before it is rendered on the page.

Load Load Load Load

發生於載入伺服器控制項至 Page 物件時。Occurs when the server control is loaded into the Page object.

(Inherited from Control)
PreRender PreRender PreRender PreRender

Control 物件載入之後但在呈現之前發生。Occurs after the Control object is loaded but prior to rendering.

(Inherited from Control)
Unload Unload Unload Unload

發生於伺服器控制項從記憶體卸載時。Occurs when the server control is unloaded from memory.

(Inherited from Control)

明確介面實作

IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState()

如需這個成員的說明,請參閱 GetDesignModeState()For a description of this member, see GetDesignModeState().

(Inherited from Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary)

如需這個成員的說明,請參閱 SetDesignModeState(IDictionary)For a description of this member, see SetDesignModeState(IDictionary).

(Inherited from Control)
IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control)

如需這個成員的說明,請參閱 SetOwnerControl(Control)For a description of this member, see SetOwnerControl(Control).

(Inherited from Control)
IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object)

如需這個成員的說明,請參閱 AddParsedSubObject(Object)For a description of this member, see AddParsedSubObject(Object).

(Inherited from Control)

擴充方法

FindDataSourceControl(Control) FindDataSourceControl(Control) FindDataSourceControl(Control) FindDataSourceControl(Control)

傳回與指定之控制項的資料控制項相關聯的資料來源。Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String) FindFieldTemplate(Control, String) FindFieldTemplate(Control, String) FindFieldTemplate(Control, String)

傳回在指定之控制項的命名容器中所指定資料行的欄位樣板。Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control) FindMetaTable(Control) FindMetaTable(Control) FindMetaTable(Control)

傳回包含資料控制項的中繼資料表物件。Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer)

取得所指定資料控制項的預設值集合。Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer) GetMetaTable(INamingContainer) GetMetaTable(INamingContainer) GetMetaTable(INamingContainer)

取得所指定資料控制項中的資料表中繼資料。Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable)

設定所指定資料控制項中的資料表中繼資料。Sets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

設定所指定資料控制項的資料表中繼資料及預設值對應。Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object)

設定所指定資料控制項的資料表中繼資料及預設值對應。Sets the table metadata and default value mapping for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable)

判斷資料表中繼資料是否可供使用。Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

適用於

另請參閱