PagerSettings.LastPageImageUrl Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur URL ke gambar yang akan ditampilkan untuk tombol halaman terakhir.
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
Nilai Properti
URL ke gambar yang akan ditampilkan untuk tombol halaman terakhir. Defaultnya adalah string kosong (""), yang menunjukkan bahwa LastPageImageUrl tidak diatur.
Contoh
Contoh kode berikut menunjukkan cara menggunakan LastPageImageUrl properti untuk menampilkan gambar untuk tombol halaman terakhir di baris GridView pager kontrol.
<%@ 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>
Keterangan
Mode Saat properti diatur ke NextPreviousFirstLast nilai atau NumericFirstLast , gunakan LastPageImageUrl properti untuk menentukan URL ke gambar yang akan ditampilkan untuk tombol halaman terakhir.
Nota
Sebagai alternatif, Anda cukup menampilkan teks untuk tombol halaman terakhir dengan mengatur LastPageText properti alih-alih LastPageImageUrl properti . LastPageImageUrl Jika properti dan LastPageText keduanya diatur, gambar ditampilkan dengan LastPageText properti yang bertindak sebagai teks alternatif untuk gambar. Pada browser yang mendukung TipsAlat, teks ini juga ditampilkan sebagai TipsAlat untuk tombol yang sesuai.
Nilai properti ini disimpan dalam status tampilan.