DetailsView.EnablePagingCallbacks Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Recebe ou define um valor que indica se as funções de callback do lado do cliente são usadas para operações de paginação no DetailsView controlo.
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
Valor de Propriedade
true para usar funções de callback do lado do cliente para operações de paginação; caso contrário, false. A predefinição é false.
Exemplos
O exemplo de código seguinte demonstra como usar a EnablePagingCallbacks propriedade para permitir o uso de funções de callback do lado do cliente para operações de paginação.
<%@ 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>
Observações
Use a EnablePagingCallbacks propriedade para especificar se as operações de paginação são realizadas usando funções de callback do lado do cliente. Quando ativada, a paginação é realizada usando a funcionalidade de callback, que evita a necessidade de publicar a página de volta no servidor.
Note
A funcionalidade de paginação do lado do cliente só é suportada no Microsoft Internet Explorer 5.5 e posteriores e no Netscape 6.0 e posteriores.
O valor de EnablePagingCallbacks é armazenado no estado de visualização.