PagerSettings.LastPageImageUrl Proprietà

Definizione

Ottiene o imposta l'URL di un'immagine da visualizzare per il pulsante di collegamento all'ultima pagina.

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

Valore della proprietà

String

URL di un'immagine da visualizzare per il pulsante di collegamento all'ultima pagina. Il valore predefinito è una stringa vuota (""), che indica che la proprietà LastPageImageUrl non è impostata.

Esempio

Nell'esempio di codice seguente viene illustrato come usare la LastPageImageUrl proprietà per visualizzare un'immagine per il pulsante dell'ultima pagina nella riga del pager di un GridView controllo.


<%@ 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"
            firstpageimageurl="~/Images/FirstPage.jpg"
            firstpagetext="First Page" 
            lastpageimageurl="~/Images/LastPage.jpg"
            lastpagetext="Last Page" 
            nextpageimageurl="~/Images/NextPage.jpg"
            nextpagetext="Next Page" 
            previouspageimageurl="~/Images/PreviousPage.jpg"
            previouspagetext="Previous Page"    
            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"
            firstpageimageurl="~/Images/FirstPage.jpg"
            firstpagetext="First Page" 
            lastpageimageurl="~/Images/LastPage.jpg"
            lastpagetext="Last Page" 
            nextpageimageurl="~/Images/NextPage.jpg"
            nextpagetext="Next Page" 
            previouspageimageurl="~/Images/PreviousPage.jpg"
            previouspagetext="Previous Page"    
            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>

Commenti

Quando la proprietà è impostata sul NextPreviousFirstLast valore oNumericFirstLast, utilizzare la LastPageImageUrl Mode proprietà per specificare l'URL di un'immagine da visualizzare per il pulsante dell'ultima pagina.

Nota

In alternativa, è possibile visualizzare semplicemente il testo per il pulsante dell'ultima pagina impostando la proprietà anziché la LastPageText LastPageImageUrl proprietà. Se le LastPageImageUrl proprietà e LastPageText sono entrambe impostate, l'immagine viene visualizzata con la LastPageText proprietà che funge da testo alternativo per l'immagine. Nei browser che supportano le descrizioni comandi, questo testo viene visualizzato anche come descrizione comando per il pulsante corrispondente.

Il valore di questa proprietà viene archiviato nello stato di visualizzazione.

Si applica a

Vedi anche