PagerSettings.LastPageImageUrl Свойство

Определение

Получает или задает URL-адрес изображения для кнопки последней страницы.

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

Значение свойства

URL-адрес изображения для кнопки последней страницы. По умолчанию используется пустая строка (""), указывающая, что свойство LastPageImageUrl не задано.

Примеры

В следующем примере кода показано, как использовать LastPageImageUrl свойство для отображения изображения для кнопки последней страницы в строке пейджера 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>

Комментарии

Если свойству Mode присвоено NextPreviousFirstLast значение или NumericFirstLast , используйте LastPageImageUrl свойство , чтобы указать URL-адрес изображения, отображаемого для кнопки последней страницы.

Примечание

В качестве альтернативы можно просто отобразить текст для кнопки последней страницы, задав LastPageText свойство вместо LastPageImageUrl свойства . LastPageImageUrl Если свойства и LastPageText заданы, изображение отображается со свойством , LastPageText выступающим в качестве альтернативного текста для изображения. В браузерах, поддерживающих подсказки, этот текст также отображается в виде подсказки для соответствующей кнопки.

Значение этого свойства хранится в состоянии представления.

Применяется к

См. также раздел