NumericPagerField.PreviousPageText Propriété

Définition

Obtient ou définit le texte qui est affiché pour le bouton de page précédente.

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

Valeur de propriété

Texte qui est affiché pour le bouton de page précédente. La valeur par défaut est « ... ».

Exemples

L’exemple suivant montre comment personnaliser le texte affiché pour le bouton page précédente du champ du pagineur dans un DataPager contrôle.

<%@ 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>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NumericPagerField Example</h3>
      
      <h4>Products List</h4>
              
      <asp:ListView runat="server" ID="ProductListView"
        DataSourceID="ProductsDataSource"
        DataKeyNames="ProductID"
        GroupItemCount="2">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" runat="server" id="tblProducts">
            <tr runat="server" id="groupPlaceholder">
            </tr>
          </table>
          <br />
          <asp:DataPager ID="DataPager1" runat="server" PageSize="6" >
            <Fields>                
              <asp:NumericPagerField                
                ButtonType="Button"
                ButtonCount="15"
                NextPageText="Next >>"
                PreviousPageText="Previous <<" />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <GroupTemplate>
          <tr runat="server" id="ProductRow">
            <td runat="server" id="itemPlaceholder"></td>
          </tr>
        </GroupTemplate>
        <ItemTemplate>
          <td runat="server">
            <asp:Image ID="ProductImage" runat="server"
              ImageUrl='<%#"~/images/" + Eval("ThumbnailPhotoFileName") %>' />
            <div>
              <asp:Label ID="ProductName" runat="server" 
                Text='<%# Eval("Name") %>' 
                Font-Italic="true" />
              <br />
              Price:
              <asp:Label ID="Price" runat="server" Text='<%# Eval("ListPrice", "{0:c}")%>' />
              <br /><br />
            </div>
          </td>
        </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="ProductsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT P.ProductID, P.Name, P.Color, P.ListPrice, 
          PF.ThumbnailPhotoFileName, P.Size
          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>NumericPagerField Example</title>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NumericPagerField Example</h3>
      
      <h4>Products List</h4>
              
      <asp:ListView runat="server" ID="ProductListView"
        DataSourceID="ProductsDataSource"
        DataKeyNames="ProductID"
        GroupItemCount="2">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" runat="server" id="tblProducts">
            <tr runat="server" id="groupPlaceholder">
            </tr>
          </table>
          <br />
          <asp:DataPager ID="DataPager1" runat="server" PageSize="6" >
            <Fields>                
              <asp:NumericPagerField                
                ButtonType="Button"
                ButtonCount="15"
                NextPageText="Next >>"
                PreviousPageText="Previous <<" />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <GroupTemplate>
          <tr runat="server" id="ProductRow">
            <td runat="server" id="itemPlaceholder"></td>
          </tr>
        </GroupTemplate>
        <ItemTemplate>
          <td runat="server">
            <asp:Image ID="ProductImage" runat="server"
              ImageUrl='<%#"~/images/" & Eval("ThumbnailPhotoFileName") %>' />
            <div>
              <asp:Label ID="ProductName" runat="server" 
                Text='<%# Eval("Name") %>' 
                Font-Italic="true" />
              <br />
              Price:
              <asp:Label ID="Price" runat="server" Text='<%# Eval("ListPrice", "{0:c}")%>' />
              <br /><br />
            </div>
          </td>
        </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="ProductsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT P.ProductID, P.Name, P.Color, P.ListPrice, 
          PF.ThumbnailPhotoFileName, P.Size
          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>

Remarques

Lorsque la propriété a la ButtonTypeButtonType.Imagevaleur , le texte de la PreviousPageText propriété est utilisé comme texte de remplacement pour l’image. Sur les navigateurs qui prennent en charge les info-bulles, ce texte s’affiche également en tant qu’info-bulle pour le bouton correspondant.

La valeur de cette propriété est stockée dans l’état d’affichage. Il peut être enregistré automatiquement dans un fichier de ressources à l’aide d’un outil de concepteur. Pour plus d’informations, consultez LocalizableAttributeglobalisation et localisation.

S’applique à

Voir aussi