PagerSettings.PreviousPageImageUrl Właściwość

Definicja

Pobiera lub ustawia adres URL na obraz, aby był wyświetlany dla przycisku poprzedniej strony.

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

Wartość właściwości

String

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

Przykłady

Poniższy przykład kodu pokazuje, jak używać PreviousPageImageUrl właściwości do wyświetlania obrazu dla przycisku poprzedniej strony w wierszu pager 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ść lubNextPrevious, użyj PreviousPageImageUrl właściwości , aby określić adres URL obrazu do wyświetlenia dla przycisku poprzedniej strony.

Uwaga

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

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

Dotyczy

Zobacz też