PagerSettings.PreviousPageText Vlastnost

Definice

Získá nebo nastaví text, který se má zobrazit pro předchozí tlačítko stránky.

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

Hodnota vlastnosti

String

Text, který se má zobrazit pro předchozí tlačítko stránky. Výchozí hodnota je lt&;, která se vykreslí jako "<".

Příklady

Následující příklad kódu ukazuje, jak použít PreviousPageText vlastnost k přizpůsobení textu zobrazeného pro tlačítko předchozí stránky řádku pager v ovládacím GridView prvku.


<%@ 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>

Poznámky

Mode Pokud je vlastnost nastavena na NextPreviousFirstLast hodnotu nebo NextPrevious hodnotu, použijte PreviousPageText vlastnost k určení textu, který se má zobrazit pro tlačítko předchozí stránky.

Poznámka

Jako alternativu můžete zobrazit obrázek tlačítka předchozí stránky nastavením PreviousPageImageUrl vlastnosti místo PreviousPageText vlastnosti. PreviousPageImageUrl Pokud jsou obě PreviousPageText vlastnosti nastaveny, obrázek se zobrazí s PreviousPageText vlastností, která funguje jako alternativní text obrázku. V prohlížečích, které podporují popisy, se tento text zobrazí také jako popis odpovídajícího tlačítka.

Hodnota této vlastnosti je uložena ve stavu zobrazení.

Platí pro

Viz také