NumericPagerField.NumericButtonCssClass 속성

정의

페이저 필드의 페이지 번호 단추에 대한 스타일을 지정하는 데 사용되는 CSS 스타일시트 클래스를 가져오거나 설정합니다.

public:
 property System::String ^ NumericButtonCssClass { System::String ^ get(); void set(System::String ^ value); };
public string NumericButtonCssClass { get; set; }
member this.NumericButtonCssClass : string with get, set
Public Property NumericButtonCssClass As String

속성 값

String

페이저 필드의 페이지 번호 단추에 대한 스타일을 지정하는 데 사용되는 CSS 클래스입니다. 기본값은 빈 문자열("")로, NumericButtonCssClass 속성이 설정되지 않았음을 나타냅니다.

예제

다음 예제에서는 페이지 번호 단추에 스타일을 지정 하는 CSS 클래스를 지정 하는 방법을 보여 줍니다 합니다 NumericPagerField 의 개체는 DataPager 컨트롤입니다.

<%@ 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>NumericPagerField Example</title>
    <style type="text/css">
      .PagerNormal
      {
        font: 9pt Verdana;
        color: #0066CF;
        border: solid 1px #778899;
        padding: 1px 4px;
        text-decoration:none;
      }
      .PagerCurrent
      {
        font: 9pt Verdana;
        border: solid 1px #778899;
        padding: 1px 4px;
        background-color: #FFD700;
      }
    </style>
  </head>
  <body>
    <form id="form1" runat="server">
        
      <h3>NumericPagerField Example</h3>
          
      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>        
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr runat="server">
              <th runat="server">ID</th>
              <th runat="server">First Name</th>
              <th runat="server">Last Name</th>
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
          <br />
          <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
            <Fields>
              <asp:NumericPagerField
                ButtonCount="10"
                CurrentPageLabelCssClass="PagerCurrent"
                NextPreviousButtonCssClass="PagerNormal" 
                NumericButtonCssClass="PagerNormal"
                NextPageText=">>"
                PreviousPageText="<<" />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%#Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%#Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%#Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <!-- 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="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </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>NumericPagerField Example</title>
    <style type="text/css">
      .PagerNormal
      {
        font: 9pt Verdana;
        color: #0066CF;
        border: solid 1px #778899;
        padding: 1px 4px;
        text-decoration:none;
      }
      .PagerCurrent
      {
        font: 9pt Verdana;
        border: solid 1px #778899;
        padding: 1px 4px;
        background-color: #FFD700;
      }
    </style>
  </head>
  <body>
    <form id="form1" runat="server">
        
      <h3>NumericPagerField Example</h3>
          
      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>        
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr runat="server">
              <th runat="server">ID</th>
              <th runat="server">First Name</th>
              <th runat="server">Last Name</th>
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
          <br />
          <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
            <Fields>
              <asp:NumericPagerField
                ButtonCount="10"
                CurrentPageLabelCssClass="PagerCurrent"
                NextPreviousButtonCssClass="PagerNormal" 
                NumericButtonCssClass="PagerNormal"
                NextPageText=">>"
                PreviousPageText="<<" />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%# Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <!-- 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="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </asp:SqlDataSource>
      
    </form>
  </body>
</html>

설명

페이지 번호 단추가 표시 됩니다는 NumericPagerField 클래스를 개별 페이지로 직접 이동할 수 있도록 합니다. 지정 된 CSS 클래스를 NumericButtonCssClass 속성에 표시 되는 모든 페이지 번호를 적용할는 NumericPagerField 현재 선택 되어 있는 페이지를 제외 하 고 개체입니다. 현재 선택 된 페이지에 지정 된 CSS 클래스를 사용 하 여 CurrentPageLabelCssClass 속성입니다.

합니다 NumericButtonCssClass 속성은 항상으로 렌더링을 class 브라우저에 관계 없이 특성입니다.

참고

설정 CSS를 지원 하지 않는 브라우저는 NumericButtonCssClass 속성이 적용 되지 않습니다.

이 속성의 값은 뷰 상태에 저장 됩니다.

적용 대상

추가 정보