DetailsView.EnablePagingCallbacks 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 menetapkan nilai yang menunjukkan apakah fungsi panggilan balik sisi klien digunakan untuk operasi penomoran dalam DetailsView kontrol.
public:
virtual property bool EnablePagingCallbacks { bool get(); void set(bool value); };
public virtual bool EnablePagingCallbacks { get; set; }
member this.EnablePagingCallbacks : bool with get, set
Public Overridable Property EnablePagingCallbacks As Boolean
Nilai Properti
true untuk menggunakan fungsi panggilan balik sisi klien untuk operasi paging; jika tidak, false. Defaultnya adalah false.
Contoh
Contoh kode berikut menunjukkan cara menggunakan EnablePagingCallbacks properti untuk mengaktifkan penggunaan fungsi panggilan balik sisi klien untuk operasi paging.
<%@ 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>DetailsView EnablePagingCallbacks Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView EnablePagingCallbacks Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
autogeneraterows="true"
allowpaging="true"
enablepagingcallbacks="true"
runat="server">
<fieldheaderstyle backcolor="Navy"
forecolor="White"/>
<pagersettings mode="NextPreviousFirstLast"
firstpagetext="First"
lastpagetext="Last"
nextpagetext="Next"
previouspagetext="Prev"/>
<pagerstyle forecolor="White"
backcolor="Blue"
font-names="Arial"
font-size="8" />
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country] From
[Customers]">
</asp:SqlDataSource>
</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>DetailsView EnablePagingCallbacks Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView EnablePagingCallbacks Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
autogeneraterows="true"
allowpaging="true"
enablepagingcallbacks="true"
runat="server">
<fieldheaderstyle backcolor="Navy"
forecolor="White"/>
<pagersettings mode="NextPreviousFirstLast"
firstpagetext="First"
lastpagetext="Last"
nextpagetext="Next"
previouspagetext="Prev"/>
<pagerstyle forecolor="White"
backcolor="Blue"
font-names="Arial"
font-size="8" />
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country] From
[Customers]">
</asp:SqlDataSource>
</form>
</body>
</html>
Keterangan
EnablePagingCallbacks Gunakan properti untuk menentukan apakah operasi halaman dilakukan menggunakan fungsi panggilan balik sisi klien. Saat diaktifkan, halaman dilakukan menggunakan fitur panggilan balik, yang mencegah kebutuhan untuk memposting halaman kembali ke server.
Nota
Fitur halaman sisi klien hanya didukung di Microsoft Internet Explorer 5.5 dan yang lebih baru dan Netscape 6.0 dan yang lebih baru.
Nilai EnablePagingCallbacks disimpan dalam status tampilan.