DetailsView.EnablePagingCallbacks Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob clientseitige Rückruffunktionen für Pagingvorgänge im DetailsView-Steuerelement verwendet werden, oder legt diesen Wert fest.

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

Eigenschaftswert

Boolean

true, wenn clientseitige Rückruffunktionen für Pagingvorgänge verwendet werden, andernfalls false. Der Standardwert ist false.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie Sie die EnablePagingCallbacks Eigenschaft verwenden, um die Verwendung clientseitiger Rückruffunktionen für Pagingvorgänge zu ermöglichen.


<%@ 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>

Hinweise

Verwenden Sie die EnablePagingCallbacks Eigenschaft, um anzugeben, ob Pagingvorgänge mithilfe clientseitiger Rückruffunktionen ausgeführt werden. Wenn dies aktiviert ist, wird das Paging mithilfe des Rückruffeatures ausgeführt, wodurch verhindert wird, dass die Seite wieder auf dem Server postiert werden muss.

Hinweis

Das clientseitige Seitenseitenfeature wird nur in Microsoft Internet Explorer 5.5 und höher und Netscape 6.0 und höher unterstützt.

Der Wert EnablePagingCallbacks wird im Ansichtszustand gespeichert.

Gilt für

Siehe auch