DetailsView.EnablePagingCallbacks Proprietà

Definizione

Ottiene o imposta un valore che indica se vengono utilizzate funzioni di callback sul lato client per le operazioni di spostamento nel controllo DetailsView.

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

Valore della proprietà

true per utilizzare funzioni di callback sul lato client per le operazioni di spostamento; in caso contrario, false. Il valore predefinito è false.

Esempio

Nell'esempio di codice seguente viene illustrato come usare la EnablePagingCallbacks proprietà per abilitare l'uso delle funzioni di callback lato client per le operazioni di 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>

Commenti

Utilizzare la EnablePagingCallbacks proprietà per specificare se le operazioni di paging vengono eseguite usando le funzioni di callback lato client. Se abilitata, il paging viene eseguito usando la funzionalità di callback, che impedisce la necessità di pubblicare nuovamente la pagina nel server.

Nota

La funzionalità di paging lato client è supportata solo in Microsoft Internet Explorer 5.5 e versioni successive e Netscape 6.0 e versioni successive.

Il valore di viene archiviato nello stato di EnablePagingCallbacks visualizzazione.

Si applica a

Vedi anche