PagerSettings.LastPageText Propriété

Définition

Obtient ou définit le texte à afficher pour le bouton de dernière page.

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

Valeur de propriété

Texte à afficher pour le bouton de dernière page. La valeur par défaut est ">>", qui s’affiche sous la forme ">>".

Exemples

L’exemple de code suivant montre comment utiliser la LastPageText propriété pour personnaliser le texte affiché pour le bouton de dernière page de la ligne de pagineur dans un GridView 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 runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>PagerSetting Example</h3>
                       
        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">
          
          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 
            
        </asp:gridview>
        
        <br/>
        
        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>
            
        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>
            
      </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 runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>PagerSetting Example</h3>
                       
        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">
          
          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 
            
        </asp:gridview>
        
        <br/>
        
        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>
            
        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>
            
      </form>
  </body>
</html>

Remarques

Lorsque la Mode propriété est définie sur la NextPreviousFirstLast valeur ou NumericFirstLast , utilisez la LastPageText propriété pour spécifier le texte à afficher pour le bouton de dernière page.

Notes

Vous pouvez également afficher une image pour le bouton de dernière page en définissant la LastPageImageUrl propriété au lieu de la LastPageText propriété . Si les LastPageImageUrl propriétés et LastPageText sont toutes deux définies, l’image s’affiche avec la LastPageText propriété agissant comme texte de remplacement pour l’image. Sur les navigateurs qui prennent en charge les info-bulles, ce texte est également affiché sous forme d’info-bulle pour le bouton correspondant.

La valeur de cette propriété est stockée dans l’état d’affichage.

S’applique à

Voir aussi