DataPager 類別

定義

提供實作 IPageableItemContainer 介面的資料繫結控制項分頁功能,例如 ListView 控制項。Provides paging functionality for data-bound controls that implement the IPageableItemContainer interface, such as the ListView control.

public ref class DataPager : System::Web::UI::Control, System::Web::UI::IAttributeAccessor, System::Web::UI::INamingContainer, System::Web::UI::WebControls::ICompositeControlDesignerAccessor
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.DataPager), "DataPager.bmp")]
[System.Web.UI.Themeable(true)]
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.DataPager), "DataPager.ico")]
public class DataPager : System.Web.UI.Control, System.Web.UI.IAttributeAccessor, System.Web.UI.INamingContainer, System.Web.UI.WebControls.ICompositeControlDesignerAccessor
type DataPager = class
    inherit Control
    interface IAttributeAccessor
    interface INamingContainer
    interface ICompositeControlDesignerAccessor
Public Class DataPager
Inherits Control
Implements IAttributeAccessor, ICompositeControlDesignerAccessor, INamingContainer
繼承
DataPager
屬性
實作

範例

下列範例顯示如何將分頁功能新增至 @no__t 0 控制項。The following example shows how to add paging functionality to a ListView control. 這個範例包含兩個 @no__t 0 控制項,可用來逐頁查看相同的 @no__t 1 控制項的資料。This example contains two DataPager controls that are used to page through data of the same ListView control.

<%@ 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 id="Head1" runat="server">
    <title>DataPager Example</title>
    <style type="text/css">        
      th
      {
        background-color:#eef4fa;
        border-top:solid 1px #9dbbcc;
        border-bottom:solid 1px #9dbbcc;
      }
      .itemSeparator { border-right: 1px solid #ccc }
      .groupSeparator
      {
        height: 1px;
        background-color: #cccccc;
      }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>DataPager Example</h3>
      
      <!-- The first DataPager control. -->
      <asp:DataPager runat="server" ID="BeforeListDataPager"
        PagedControlID="ProductsListView" 
        PageSize="18">
        <Fields>
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowFirstPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            FirstPageImageUrl="~/images/first.gif" />
          <asp:NumericPagerField ButtonCount="10" />
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowLastPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            LastPageImageUrl="~/images/last.gif" />
        </Fields>
      </asp:DataPager>

      <asp:ListView ID="ProductsListView" 
        DataSourceID="ProductsDataSource" 
        GroupItemCount="3"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" id="tbl1" runat="server">
            <tr>
              <th colspan="5">PRODUCTS LIST</th>
            </tr>
            <tr runat="server" id="groupPlaceholder"></tr>
          </table>
        </LayoutTemplate>
        <GroupTemplate>
          <tr runat="server" id="tr1">
            <td runat="server" id="itemPlaceholder"></td>
          </tr>
        </GroupTemplate>
        <GroupSeparatorTemplate>
          <tr runat="server">
            <td colspan="5">
                <div class="groupSeparator"><hr></div>
              </td>
          </tr>
        </GroupSeparatorTemplate>
        <ItemTemplate>
          <td align="center" runat="server">
            <asp:HyperLink ID="ProductLink" runat="server" 
              Text='<%# Eval("Name") %>' 
              NavigateUrl='<%# "ProductDetails.aspx?productID=" + Eval("ProductID") %>' /><br />
            <asp:Image ID="ProductImage" runat="server"
              ImageUrl='<%#"~/images/thumbnails/" + Eval("ThumbnailPhotoFileName") %>' /><br />
            <b>Price:</b> <%# Eval("ListPrice", "{0:c}")%> <br />
          </td>
        </ItemTemplate>
        <ItemSeparatorTemplate>
          <td class="itemSeparator" runat="server">&nbsp;</td>
        </ItemSeparatorTemplate>
      </asp:ListView>

      <!-- The second DataPager control. -->
      <asp:DataPager runat="server" ID="AfterListDataPager"
        PagedControlID="ProductsListView" 
        PageSize="18">
        <Fields>
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowFirstPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            FirstPageImageUrl="~/images/first.gif" />
          <asp:NumericPagerField ButtonCount="10" />
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowLastPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            LastPageImageUrl="~/images/last.gif" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ProductsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"            	        
        SelectCommand="SELECT P.ProductID, P.Name, P.Color, P.ListPrice, 
          PF.ThumbnailPhotoFileName
          FROM Production.Product AS P 
          INNER JOIN Production.ProductProductPhoto AS PPF ON P.ProductID = PPF.ProductID 
          INNER JOIN Production.ProductPhoto AS PF ON PPF.ProductPhotoID = PF.ProductPhotoID">
      </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 id="Head1" runat="server">
    <title>DataPager Example</title>
    <style type="text/css">        
      th
      {
        background-color:#eef4fa;
        border-top:solid 1px #9dbbcc;
        border-bottom:solid 1px #9dbbcc;
      }
      .itemSeparator { border-right: 1px solid #ccc }
      .groupSeparator
      {
        height: 1px;
        background-color: #cccccc;
      }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>DataPager Example</h3>
      
      <!-- The first DataPager control. -->
      <asp:DataPager runat="server" ID="BeforeListDataPager"
        PagedControlID="ProductsListView" 
        PageSize="18">
        <Fields>
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowFirstPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            FirstPageImageUrl="~/images/first.gif" />
          <asp:NumericPagerField ButtonCount="10" />
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowLastPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            LastPageImageUrl="~/images/last.gif" />
        </Fields>
      </asp:DataPager>

      <asp:ListView ID="ProductsListView" 
        DataSourceID="ProductsDataSource" 
        GroupItemCount="3"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" id="tbl1" runat="server">
            <tr>
              <th colspan="5">PRODUCTS LIST</th>
            </tr>
            <tr runat="server" id="groupPlaceholder"></tr>
          </table>
        </LayoutTemplate>
        <GroupTemplate>
          <tr runat="server" id="tr1">
            <td runat="server" id="itemPlaceholder"></td>
          </tr>
        </GroupTemplate>
        <GroupSeparatorTemplate>
          <tr runat="server">
            <td colspan="5">
                <div class="groupSeparator"><hr></div>
              </td>
          </tr>
        </GroupSeparatorTemplate>
        <ItemTemplate>
          <td align="center" runat="server">
            <asp:HyperLink ID="ProductLink" runat="server" 
              Text='<%# Eval("Name") %>' 
              NavigateUrl='<%# "ProductDetails.aspx?productID=" & Eval("ProductID") %>' /><br />
            <asp:Image ID="ProductImage" runat="server"
              ImageUrl='<%#"~/images/thumbnails/" & Eval("ThumbnailPhotoFileName") %>' /><br />
            <b>Price:</b> <%# Eval("ListPrice", "{0:c}")%> <br />
          </td>
        </ItemTemplate>
        <ItemSeparatorTemplate>
          <td class="itemSeparator" runat="server">&nbsp;</td>
        </ItemSeparatorTemplate>
      </asp:ListView>

      <!-- The second DataPager control. -->
      <asp:DataPager runat="server" ID="AfterListDataPager"
        PagedControlID="ProductsListView" 
        PageSize="18">
        <Fields>
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowFirstPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            FirstPageImageUrl="~/images/first.gif" />
          <asp:NumericPagerField ButtonCount="10" />
          <asp:NextPreviousPagerField ButtonType="Image"
            ShowLastPageButton="true"
            ShowNextPageButton="false"
            ShowPreviousPageButton="false"
            LastPageImageUrl="~/images/last.gif" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ProductsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"            	        
        SelectCommand="SELECT P.ProductID, P.Name, P.Color, P.ListPrice, 
          PF.ThumbnailPhotoFileName
          FROM Production.Product AS P 
          INNER JOIN Production.ProductProductPhoto AS PPF ON P.ProductID = PPF.ProductID 
          INNER JOIN Production.ProductPhoto AS PF ON PPF.ProductPhotoID = PF.ProductPhotoID">
      </asp:SqlDataSource>
      
    </form>
  </body>
</html>

備註

本主題內容:In this topic:

簡介Introduction

@No__t-0 類別是用來分頁資料,並顯示用來執行 @no__t 1 介面之資料繫結控制項的導覽控制項。The DataPager class is used to page data and to display navigation controls for data-bound controls that implement the IPageableItemContainer interface. (實作為介面的控制項範例是 @no__t 0 的控制項)。(An example of a control that implements the interface is the ListView control.)

您可以使用 PagedControlID 屬性,將 DataPager 控制項與資料繫結控制項產生關聯。You can associate the DataPager control with the data-bound control by using the PagedControlID property. 或者,您可以將 DataPager 控制項放在資料繫結控制項階層中。Alternatively, you can put the DataPager control inside the data-bound control hierarchy. 例如,在 ListView 控制項中,您可以將 @no__t 1 控制項放在 @no__t 2 範本內。For example, in the ListView control, you can put the DataPager control inside the ListView.LayoutTemplate template.

您可以藉由變更 PageSize 屬性來自訂每個資料頁所顯示的專案數。You can customize the number of items that are displayed for each page of data by changing the PageSize property. 您也可以藉由設定 QueryStringField 屬性來變更頁面提交至伺服器的方式。You can also change the way a page is submitted to the server by setting the QueryStringField property.

呼機欄位Pager Fields

若要讓 DataPager 控制項顯示導覽控制項,您必須將頁面導航欄位加入至控制項。In order for the DataPager control to display navigation controls, you must add pager fields to the control. 分頁欄位衍生自 DataPagerField 類別。The pager fields derive from the DataPagerField class. 下表列出您可以使用的分頁程式欄位類型。The following table lists the pager field types that you can use.

呼機欄位類型Pager field type 說明Description
NextPreviousPagerField 可讓使用者一次流覽一頁頁面,或跳到第一個或最後一頁。Enables users to navigate through pages one page at a time, or to jump to the first or last page.
NumericPagerField 可讓使用者依頁碼選取頁面。Enables users to select a page by page number.
TemplatePagerField 可讓您建立自訂分頁 UI。Enables you to create a custom paging UI.

若要以宣告方式將分頁欄位加入至 @no__t 0 控制項,請將 @no__t 1 專案加入至 @no__t 2 控制項。To declaratively add pager fields to the DataPager control, add a Fields element to the DataPager control. 然後,您可以將分頁欄位新增至 Fields 元素。You can then add the pager fields to the Fields element. 會依照出現在 Fields 元素中的順序,將分頁欄位加入至 Fields 集合。The pager fields are added to the Fields collection in the order that they appear in the Fields element. @No__t-0 集合可讓您以程式設計方式管理 @no__t 1 控制項中的頁面導航欄位。The Fields collection enables you to programmatically manage the pager fields in the DataPager control.

頁面屬性Page Properties

下表列出指定資料頁特性之 @no__t 0 控制項的唯讀屬性。The following table lists read-only properties of the DataPager control that specify characteristics of the page of data. 這些屬性通常用於 TemplatePagerField 物件中的系結運算式。These properties are usually used for binding expressions in the TemplatePagerField object.

屬性Property 說明Description
MaximumRows 每個資料頁上顯示的最大資料錄筆數。The maximum number of records that are displayed for each page of data.
StartRowIndex 顯示在資料頁上第一筆資料錄的索引。The index of the first record that is displayed on a page of data.
TotalRowCount 基礎資料來源中可用的記錄總數。The total number of records that are available in the underlying data source.

協助工具選項Accessibility

此控制項預設呈現的預設標記可能不符合協助工具標準,例如 Web 內容協助工具指導方針1.0 (WCAG)優先順序1指導方針。The default markup that is rendered default for this control might not comply with accessibility standards, such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. 如需此控制項協助工具支援的詳細資訊,請參閱ASP.NET 控制項和協助工具For details about accessibility support for this control, see ASP.NET Controls and Accessibility.

宣告式語法Declarative Syntax

<asp:DataPager  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    ID="string"  
    OnDataBinding="DataBinding event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnLoad="Load event handler"  
    OnPreRender="PreRender event handler"  
    OnUnload="Unload event handler"  
    PagedControlID="string"  
    PageSize="integer"  
    runat="server"  
    SkinID="string"  
    Visible="True|False"  
>  
        <Fields>  
            <asp:NextPreviousPagerField  
                ButtonCssClass="string"  
                ButtonType="Button|Image|Link"  
                FirstPageImageUrl="string"  
                FirstPageText="string"  
                LastPageImageUrl="string"  
                LastPageText="string"  
                NextPageImageUrl="string"  
                NextPageText="string"  
                PreviousPageImageUrl="string"  
                PreviousPageText="string"  
                RenderDisabledButtonsAsLabels="True|False"  
                RenderNonBreakingSpacesBetweenControls="True|False"  
                ShowFirstPageButton="True|False"  
                ShowLastPageButton="True|False"  
                ShowNextPageButton="True|False"  
                ShowPreviousPageButton="True|False"  
                Visible="True|False"  
            />  
            <asp:NumericPagerField  
                ButtonCount="integer"  
                ButtonType="Button|Image|Link"  
                CurrentPageLabelCssClass="string"  
                NextPageImageUrl="string"  
                NextPageText="string"  
                NextPreviousButtonCssClass="string"  
                NumericButtonCssClass="string"                 PreviousPageImageUrl="string"  
                PreviousPageText="string"  
                RenderNonBreakingSpacesBetweenControls="True|False"  
                Visible="True|False"  
            />  
            <asp:TemplatePagerField  
                OnPagerCommand="PagerCommand event handler"  
                Visible="True|False"  
            />  
        </Fields>  
</asp:DataPager>  

建構函式

DataPager()

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

屬性

Adapter

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

(繼承來源 Control)
AppRelativeTemplateSourceDirectory

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

(繼承來源 Control)
Attributes

取得 DataPager 控制項的自訂屬性名稱/值組集合。Gets a collection of custom attribute name/value pairs for the DataPager control.

BindingContainer

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

(繼承來源 Control)
ChildControlsCreated

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

(繼承來源 Control)
ClientID

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

(繼承來源 Control)
ClientIDMode

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

(繼承來源 Control)
ClientIDSeparator

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

(繼承來源 Control)
Context

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

(繼承來源 Control)
Controls

取得 ControlCollection 物件,這個物件表示 UI 階層架構中 DataPager 控制項的子控制項。Gets a ControlCollection object that represents the child controls for the DataPager control in the UI hierarchy.

DataItemContainer

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

(繼承來源 Control)
DataKeysContainer

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

(繼承來源 Control)
DesignMode

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

(繼承來源 Control)
EnableTheming

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

(繼承來源 Control)
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.

(繼承來源 Control)
Events

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

(繼承來源 Control)
Fields

取得 DataPagerField 物件的集合,這些物件表示 DataPager 控制項中指定的頁面巡覽區欄位。Gets a collection of DataPagerField objects that represent the pager fields that are specified in a DataPager control.

HasChildViewState

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

(繼承來源 Control)
ID

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

(繼承來源 Control)
IdSeparator

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

(繼承來源 Control)
IsChildControlStateCleared

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

(繼承來源 Control)
IsTrackingViewState

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

(繼承來源 Control)
IsViewStateEnabled

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

(繼承來源 Control)
LoadViewStateByID

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

(繼承來源 Control)
MaximumRows

取得每個資料頁上顯示的最大資料錄筆數。Gets the maximum number of records that are displayed for each page of data.

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.

(繼承來源 Control)
Page

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

(繼承來源 Control)
PagedControlID

取得或設定控制項的 ID,這個控制項包含 DataPager 控制項要進行分頁的資料。Gets or sets the ID of the control that contains the data that will be paged by the DataPager control.

PageSize

取得或設定每個資料頁上顯示的資料錄筆數。Gets or sets the number of records that are displayed for each page of data.

Parent

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

(繼承來源 Control)
QueryStringField

取得或設定查詢字串欄位的名稱。Gets or sets the name of the query string field.

RenderingCompatibility

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

(繼承來源 Control)
Site

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

(繼承來源 Control)
SkinID

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

(繼承來源 Control)
StartRowIndex

取得資料頁上顯示的第一筆記錄的索引。Gets the index of the first record that is displayed on a page of data .

TagKey

取得用於呈現 DataPager 控制項的 HTML 項目。Gets the HTML element that is used to render the DataPager control.

TemplateControl

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

(繼承來源 Control)
TemplateSourceDirectory

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

(繼承來源 Control)
TotalRowCount

取得由相關資料繫結控制項參考之基礎資料來源物件所擷取的資料錄總數。Gets the total number of records that are retrieved by the underlying data source object that is referenced by the associated data-bound control.

UniqueID

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

(繼承來源 Control)
ValidateRequestMode

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

(繼承來源 Control)
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.

(繼承來源 Control)
ViewStateIgnoresCase

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

(繼承來源 Control)
ViewStateMode

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

(繼承來源 Control)
Visible

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

(繼承來源 Control)

方法

AddAttributesToRender(HtmlTextWriter)

將要呈現在瀏覽器中的 HTML 屬性和樣式加入至指定的 HtmlTextWriter 物件。Adds HTML attributes and styles to be rendered in the browser to the specified HtmlTextWriter object.

AddedControl(Control, Int32)

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

(繼承來源 Control)
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.

(繼承來源 Control)
ApplyStyleSheetSkin(Page)

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

(繼承來源 Control)
BeginRenderTracing(TextWriter, Object)

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

(繼承來源 Control)
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.

(繼承來源 Control)
ClearCachedClientID()

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

(繼承來源 Control)
ClearChildControlState()

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

(繼承來源 Control)
ClearChildState()

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

(繼承來源 Control)
ClearChildViewState()

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

(繼承來源 Control)
ClearEffectiveClientIDMode()

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

(繼承來源 Control)
ConnectToEvents(IPageableItemContainer)

將事件連接至 DataPager 控制項中的事件處理常式方法。Connects events to event handler methods in the DataPager control.

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.

(繼承來源 Control)
CreateControlCollection()

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

(繼承來源 Control)
CreatePagerFields()

建立由 DataPagerField 控制項的 Fields 屬性所包含的 DataPager 物件。Creates the DataPagerField objects that are contained by the Fields property of the DataPager control.

DataBind()

DataPager 控制項和其所有子控制項繫結至資料來源。Binds the DataPager control and all its child controls to a data source.

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.

(繼承來源 Control)
DataBindChildren()

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

(繼承來源 Control)
Dispose()

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

(繼承來源 Control)
EndRenderTracing(TextWriter, Object)

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

(繼承來源 Control)
EnsureChildControls()

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

(繼承來源 Control)
EnsureID()

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

(繼承來源 Control)
Equals(Object)

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

(繼承來源 Object)
FindControl(String)

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

(繼承來源 Control)
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.

(繼承來源 Control)
FindPageableItemContainer()

擷取與 DataPager 控制項關聯的資料繫結控制項。Retrieves the data-bound control that is associated with the DataPager control.

Focus()

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

(繼承來源 Control)
GetDesignModeState()

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

(繼承來源 Control)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetRouteUrl(Object)

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

(繼承來源 Control)
GetRouteUrl(RouteValueDictionary)

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

(繼承來源 Control)
GetRouteUrl(String, Object)

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

(繼承來源 Control)
GetRouteUrl(String, RouteValueDictionary)

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

(繼承來源 Control)
GetType()

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

(繼承來源 Object)
GetUniqueIDRelativeTo(Control)

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

(繼承來源 Control)
HasControls()

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

(繼承來源 Control)
HasEvents()

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

(繼承來源 Control)
IsLiteralContent()

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

(繼承來源 Control)
LoadControlState(Object)

載入 DataPager 控制項中必須在回傳之間保存的屬性 (Property) 狀態資訊,即使 EnableViewState 屬性設定為 false 也一樣。Loads the state information for the properties in the DataPager control that must be persisted between postbacks, even when the EnableViewState property is set to false.

LoadViewState(Object)

還原在上一個頁面要求時,DataPager 方法為 SaveViewState() 控制項儲存的檢視狀態資訊。Restores view-state information for the DataPager control that was saved by the SaveViewState() method during a previous page request.

MapPathSecure(String)

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

(繼承來源 Control)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnBubbleEvent(Object, EventArgs)

決定 DataPager 控制項的事件是否要在頁面的使用者介面 (UI) 伺服器控制階層架構中向上傳遞。Determines whether an event for the DataPager control is passed up the page's user interface (UI) server control hierarchy.

OnDataBinding(EventArgs)

引發 DataBinding 事件。Raises the DataBinding event.

(繼承來源 Control)
OnInit(EventArgs)

引發 Init 事件。Raises the Init event.

OnLoad(EventArgs)

引發 Load 事件。Raises the Load event.

OnPreRender(EventArgs)

引發 PreRender 事件。Raises the PreRender event.

(繼承來源 Control)
OnTotalRowCountAvailable(Object, PageEventArgs)

處理 TotalRowCountAvailable 事件。Handles the TotalRowCountAvailable event.

OnUnload(EventArgs)

引發 Unload 事件。Raises the Unload event.

(繼承來源 Control)
OpenFile(String)

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

(繼承來源 Control)
RaiseBubbleEvent(Object, EventArgs)

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

(繼承來源 Control)
RecreateChildControls()

在設計階段建立 DataPager 控制項的子控制項。Creates child controls of the DataPager control at design time.

RemovedControl(Control)

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

(繼承來源 Control)
Render(HtmlTextWriter)

DataPager 控制項內容傳送給指定的 HtmlTextWriter 物件來撰寫要呈現給瀏覽器的內容。Sends the DataPager control content to the specified HtmlTextWriter object, which writes the content to be rendered to the browser.

RenderBeginTag(HtmlTextWriter)

DataPager 控制項的 HTML 開頭標記呈現在指定的寫入器中。Renders the HTML opening tag of the DataPager control to the specified writer.

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.

(繼承來源 Control)
RenderContents(HtmlTextWriter)

DataPager 控制項的內容呈現給指定的寫入器。Renders the contents of the DataPager control to the specified writer.

RenderControl(HtmlTextWriter)

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

(繼承來源 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

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

(繼承來源 Control)
ResolveAdapter()

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

(繼承來源 Control)
ResolveClientUrl(String)

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

(繼承來源 Control)
ResolveUrl(String)

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

(繼承來源 Control)
SaveControlState()

將必須在不同回傳之間保存的屬性狀態儲存在 DataPager 控制項中,即使 EnableViewState 屬性 (Property) 設定為 false 也一樣。Saves the state of the properties in the DataPager control that must be persisted between postbacks, even when the EnableViewState property is set to false.

SaveViewState()

儲存對 DataPager 控制項的檢視狀態所做的任何變更,這些變更是網頁被回傳到伺服器時所發生。Saves any changes to an DataPager control's view-state that have occurred since the time the page was posted back to the server.

SetDesignModeState(IDictionary)

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

(繼承來源 Control)
SetPageProperties(Int32, Int32, Boolean)

DataPager 控制項中設定頁面相關屬性。Sets the page-related properties in the DataPager control.

SetRenderMethodDelegate(RenderMethod)

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

(繼承來源 Control)
SetTraceData(Object, Object)

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

(繼承來源 Control)
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.

(繼承來源 Control)
ToString()

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

(繼承來源 Object)
TrackViewState()

追蹤 DataPager 控制項的檢視狀態變更,讓這些變更能夠儲存在控制項的 StateBag 物件中。Tracks view-state changes to the DataPager control so that they can be stored in the control's StateBag object. 您透過 ViewState 屬性 (Property) 存取這個物件。This object can be accessed through the ViewState property.

事件

DataBinding

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

(繼承來源 Control)
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.

(繼承來源 Control)
Init

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

(繼承來源 Control)
Load

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

(繼承來源 Control)
PreRender

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

(繼承來源 Control)
Unload

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

(繼承來源 Control)

明確介面實作

IAttributeAccessor.GetAttribute(String)

DataPager 控制項中擷取具有所指定名稱的屬性值。Retrieves the attribute value with the specified name from the DataPager control.

IAttributeAccessor.SetAttribute(String, String)

使用指定的名稱和值設定 DataPager 控制項的屬性。Sets an attribute of the DataPager control with the specified name and value.

ICompositeControlDesignerAccessor.RecreateChildControls()

在設計階段建立 DataPager 控制項的子控制項。Creates the child controls of the DataPager control at design time.

IControlBuilderAccessor.ControlBuilder

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

(繼承來源 Control)
IControlDesignerAccessor.GetDesignModeState()

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

(繼承來源 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

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

(繼承來源 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

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

(繼承來源 Control)
IControlDesignerAccessor.UserData

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

(繼承來源 Control)
IDataBindingsAccessor.DataBindings

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

(繼承來源 Control)
IDataBindingsAccessor.HasDataBindings

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

(繼承來源 Control)
IExpressionsAccessor.Expressions

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

(繼承來源 Control)
IExpressionsAccessor.HasExpressions

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

(繼承來源 Control)
IParserAccessor.AddParsedSubObject(Object)

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

(繼承來源 Control)

擴充方法

FindDataSourceControl(Control)

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

FindFieldTemplate(Control, String)

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

FindMetaTable(Control)

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

GetDefaultValues(INamingContainer)

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

GetMetaTable(INamingContainer)

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

SetMetaTable(INamingContainer, MetaTable)

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

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

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

SetMetaTable(INamingContainer, MetaTable, Object)

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

TryGetMetaTable(INamingContainer, MetaTable)

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

EnableDynamicData(INamingContainer, Type)

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

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

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

EnableDynamicData(INamingContainer, Type, Object)

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

適用於

另請參閱