PagerSettings.NextPageImageUrl Właściwość

Definicja

Pobiera lub ustawia adres URL obrazu w celu wyświetlenia przycisku następnej strony.

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

Wartość właściwości

String

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

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą NextPageImageUrl właściwości wyświetlić obraz przycisku następnej strony w wierszu stronicowania GridView kontrolki.


<%@ 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 NumericFirstLast wartość lubNextPrevious, użyj NextPageImageUrl właściwości , aby określić adres URL obrazu do wyświetlenia dla przycisku następnej strony.

Uwaga

Alternatywnie możesz po prostu wyświetlić tekst przycisku następnej strony, ustawiając NextPageText właściwość zamiast NextPageImageUrl właściwości. NextPageImageUrl Jeśli właściwości i NextPageText są ustawione, obraz jest wyświetlany z NextPageText 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ż