NextPreviousPagerField.PreviousPageText 속성

정의

이전 페이지 단추에 대해 표시할 텍스트를 가져오거나 설정합니다.

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

속성 값

String

이전 페이지 단추에 대해 표시할 텍스트입니다. 기본값은 "Previous"입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 PreviousPageText 페이저 필드의 이전 페이지 단추에 대 한 텍스트를 사용자 지정 속성을 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>NextPreviousPagerField Example</title>
    <style type="text/css">
      .pager { background-color:Aqua; }
    </style>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
          <asp:DataPager runat="server" ID="ContactsDataPager">
            <Fields>
              <asp:NextPreviousPagerField 
                  ShowFirstPageButton="true" 
                  ShowLastPageButton="true"
                  FirstPageText="|<< " 
                  LastPageText=" >>|"
                  NextPageText=" > " 
                  PreviousPageText=" < " 
                  ButtonType="Button" 
                  ButtonCssClass="pager" />
            </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>NextPreviousPagerField Example</title>
    <style type="text/css">
      .pager { background-color:Aqua; }
    </style>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
          <asp:DataPager runat="server" ID="ContactsDataPager">
            <Fields>
              <asp:NextPreviousPagerField 
                  ShowFirstPageButton="true" 
                  ShowLastPageButton="true"
                  FirstPageText="|<< " 
                  LastPageText=" >>|"
                  NextPageText=" > " 
                  PreviousPageText=" < " 
                  ButtonType="Button" 
                  ButtonCssClass="pager" />
            </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>

설명

경우는 ShowPreviousPageButton 속성이로 설정 된 true를 사용 하 여를 PreviousPageText 이전 페이지 단추에 표시할 텍스트를 지정 하는 속성.

경우는 ButtonType 속성이로 설정 되어 ButtonType.Image, 이미지가 표시 되 및 PreviousPageText 속성이 역할을 이미지에 대 한 대체 텍스트입니다. 도구 설명을 지 원하는 브라우저에서는이 텍스트는 도구 설명으로도 표시 됩니다.

이 속성의 값은 viewstate에 저장 됩니다 및 디자이너 도구를 사용 하 여 리소스 파일에 자동으로 저장 될 수 있습니다. 자세한 내용은 LocalizableAttribute 하 고 전역화 및 지역화합니다.

적용 대상

추가 정보