DetailsView.EnablePagingCallbacks Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit une valeur indiquant si les fonctions de rappel côté client sont utilisées pour les opérations de pagination dans le DetailsView contrôle.
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
Valeur de propriété
true pour utiliser les fonctions de rappel côté client pour les opérations de pagination ; sinon, false. La valeur par défaut est false.
Exemples
L’exemple de code suivant montre comment utiliser la EnablePagingCallbacks propriété pour activer l’utilisation des fonctions de rappel côté client pour les opérations de pagination.
<%@ 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>
Remarques
Utilisez la EnablePagingCallbacks propriété pour spécifier si les opérations de pagination sont effectuées à l’aide de fonctions de rappel côté client. Lorsque cette option est activée, la pagination est effectuée à l’aide de la fonctionnalité de rappel, ce qui empêche la publication de la page sur le serveur.
Note
La fonctionnalité de pagination côté client est prise en charge uniquement dans Microsoft Internet Explorer 5.5 et versions ultérieures et Netscape 6.0 et versions ultérieures.
La valeur de celle-ci EnablePagingCallbacks est stockée dans l’état d’affichage.