DetailsView.EnablePagingCallbacks Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy funkcje wywołania zwrotnego po stronie klienta są używane do operacji stronicowania w kontrolce 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

Wartość właściwości

Boolean

true do używania funkcji wywołania zwrotnego po stronie klienta na potrzeby operacji stronicowania; w przeciwnym razie , false. Wartość domyślna to false.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać EnablePagingCallbacks właściwości w celu umożliwienia korzystania z funkcji wywołania zwrotnego po stronie klienta na potrzeby operacji stronicowania.


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

Uwagi

EnablePagingCallbacks Użyj właściwości , aby określić, czy operacje stronicowania są wykonywane przy użyciu funkcji wywołania zwrotnego po stronie klienta. Po włączeniu stronicowanie jest wykonywane przy użyciu funkcji wywołania zwrotnego, co uniemożliwia opublikowanie strony z powrotem na serwerze.

Uwaga

Funkcja stronicowania po stronie klienta jest obsługiwana tylko w programie Microsoft Internet Explorer 5.5 i nowszym oraz w programie Netscape 6.0 lub nowszym.

Wartość jest EnablePagingCallbacks przechowywana w stanie widoku.

Dotyczy

Zobacz też