PagerSettings.LastPageImageUrl Właściwość

Definicja

Pobiera lub ustawia adres URL obrazu do wyświetlenia dla przycisku ostatniej strony.

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

Wartość właściwości

Adres URL obrazu do wyświetlenia dla przycisku ostatniej strony. Wartość domyślna to pusty ciąg (""), który wskazuje, że LastPageImageUrl parametr nie jest ustawiony.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą LastPageImageUrl właściwości wyświetlić obraz przycisku ostatniej strony w wierszu pagera kontrolki GridView .


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

Uwagi

Mode Gdy właściwość jest ustawiona na NextPreviousFirstLast wartość lubNumericFirstLast, użyj LastPageImageUrl właściwości , aby określić adres URL obrazu do wyświetlenia dla przycisku ostatniej strony.

Uwaga

Alternatywnie możesz po prostu wyświetlić tekst dla przycisku ostatniej strony, ustawiając LastPageText właściwość zamiast LastPageImageUrl właściwości . LastPageImageUrl Jeśli obie właściwości i LastPageText są ustawione, obraz jest wyświetlany z właściwością LastPageText działającą jako alternatywny tekst obrazu. W przeglądarkach obsługujących etykietki narzędzi ten tekst jest również wyświetlany jako etykietka narzędzia odpowiedniego przycisku.

Wartość tej właściwości jest przechowywana w stanie widoku.

Dotyczy

Zobacz też