Suggérer une traduction
 
Suggestions d'autres utilisateurs :

progress indicator
Aucune autre suggestion.
Cliquez pour évaluer et commenter
MSDN
MSDN Library
Développement .NET
.NET Framework 4
Espaces de noms System.Web
System.Web.UI.WebControls
NextPreviousPagerField, classe
Réduire tout/Développer tout Réduire tout
Affichage du contenu :  côte à côteAffichage du contenu : côte à côte
.NET Framework Class Library
NextPreviousPagerField Class

Represents a field that displays navigation controls in a DataPager control enable users to page through data.

System..::.Object
  System.Web.UI.WebControls..::.DataPagerField
    System.Web.UI.WebControls..::.NextPreviousPagerField

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
Visual Basic
Public Class NextPreviousPagerField _
    Inherits DataPagerField
C#
public class NextPreviousPagerField : DataPagerField
Visual C++
public ref class NextPreviousPagerField : public DataPagerField
F#
type NextPreviousPagerField =  
    class
        inherit DataPagerField
    end

The NextPreviousPagerField type exposes the following members.

  NameDescription
Public methodNextPreviousPagerFieldInitializes a new instance of the NextPreviousPagerField class.
Top
  NameDescription
Public propertyButtonCssClassGets or sets the cascading style sheet (CSS) class that is used to render the buttons of the pager field on the browser.
Public propertyButtonTypeGets or sets the button type to display in the pager field.
Protected propertyDataPagerGets a reference to the data pager that the DataPagerField object is associated with. (Inherited from DataPagerField.)
Public propertyFirstPageImageUrlGets or sets the URL to an image that is displayed for the first-page button.
Public propertyFirstPageTextGets or sets the text that is displayed for the first-page button.
Protected propertyIsTrackingViewStateGets a value that indicates whether the DataPagerField object is tracking its view-state changes. (Inherited from DataPagerField.)
Public propertyLastPageImageUrlGets or sets the URL to an image that is displayed for the last-page button in the NextPreviousPagerField object.
Public propertyLastPageTextGets or sets the text that is displayed for the last-page button.
Public propertyNextPageImageUrlGets or sets the URL to an image that is displayed for the next-page button in the NextPreviousPagerField object.
Public propertyNextPageTextGets or sets the text that is displayed for the next-page button.
Public propertyPreviousPageImageUrlGets or sets the URL to an image that is displayed for the previous-page button in the NextPreviousPagerField object.
Public propertyPreviousPageTextGets or sets the text that is displayed for the previous-page button.
Protected propertyQueryStringHandledGets or sets a value that indicates whether the query string field has been evaluated. (Inherited from DataPagerField.)
Protected propertyQueryStringValueGets the value of the query string field from the URL of the request. (Inherited from DataPagerField.)
Public propertyRenderDisabledButtonsAsLabelsGets or sets a value that indicates whether disabled buttons are rendered as Label controls by the NextPreviousPagerField object.
Public propertyRenderNonBreakingSpacesBetweenControlsGets or sets a value that indicates whether non-breaking spaces are rendered between controls.
Public propertyShowFirstPageButtonGets or sets a value that indicates whether the first-page button is displayed in a NextPreviousPagerField object.
Public propertyShowLastPageButtonGets or sets a value that indicates whether the last-page button is displayed in a NextPreviousPagerField object.
Public propertyShowNextPageButtonGets or sets a value that indicates whether the next-page button is displayed in a NextPreviousPagerField object.
Public propertyShowPreviousPageButtonGets or sets a value that indicates whether the previous-page button is displayed in a NextPreviousPagerField object.
Protected propertyViewStateGets a dictionary of state information that enables you to save and restore the view state of a DataPagerField object across multiple requests for the same page. (Inherited from DataPagerField.)
Public propertyVisibleGets or sets a value that indicates whether a data pager field is rendered. (Inherited from DataPagerField.)
Top
  NameDescription
Protected methodCloneFieldInfrastructure. Creates a copy of the current object that is derived from DataPagerField. (Inherited from DataPagerField.)
Protected methodCopyPropertiesCopies the properties of the current NextPreviousPagerField object to the specified DataPagerField object. (Overrides DataPagerField..::.CopyProperties(DataPagerField).)
Public methodCreateDataPagersCreates the user interface (UI) controls for the pager field object and adds them to the specified container. (Overrides DataPagerField..::.CreateDataPagers(DataPagerFieldItem, Int32, Int32, Int32, Int32).)
Protected methodCreateFieldCreates and returns a new instance of the NextPreviousPagerField class. (Overrides DataPagerField..::.CreateField()()().)
Public methodEqualsDetermines whether the specified object is equal to the current NextPreviousPagerField object. (Overrides Object..::.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for the NextPreviousPagerField class. (Overrides Object..::.GetHashCode()()().)
Protected methodGetQueryStringNavigateUrlCreates a URL that contains a query string field that has the specified page number. (Inherited from DataPagerField.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHandleEventHandles events that occur in the NextPreviousPagerField control and performs the appropriate action. (Overrides DataPagerField..::.HandleEvent(CommandEventArgs).)
Protected methodLoadViewStateRestores view-state information that was saved previously. (Inherited from DataPagerField.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnFieldChangedRaises the FieldChanged event. (Inherited from DataPagerField.)
Protected methodSaveViewStateSaves the changes that were made to the DataPagerField object's view state. (Inherited from DataPagerField.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTrackViewStateCauses the DataPagerField object to track changes to its view state so that they can be stored in the control's ViewState property and persisted across requests for the same page. (Inherited from DataPagerField.)
Top
  NameDescription
Explicit interface implemetationPrivate propertyIStateManager..::.IsTrackingViewStateInfrastructure. Gets a value that indicates whether the DataPagerField object is tracking its view-state changes. (Inherited from DataPagerField.)
Explicit interface implemetationPrivate methodIStateManager..::.LoadViewStateInfrastructure. Restores view-state information that was saved previously. (Inherited from DataPagerField.)
Explicit interface implemetationPrivate methodIStateManager..::.SaveViewStateInfrastructure. Saves the changes that were made to the DataPagerField object's view state. (Inherited from DataPagerField.)
Explicit interface implemetationPrivate methodIStateManager..::.TrackViewStateInfrastructure. Causes the DataPagerField object to track changes to its view state so that they can be stored in the control's ViewState property and persisted across requests for the same page. (Inherited from DataPagerField.)
Top

The NextPreviousPagerField class represents a field that displays navigation controls in a DataPager control. These navigation controls can be used to page through data that are displayed by a control that implements the IPageableItemContainer interface, such as the ListView control.

The NextPreviousPagerField class provides buttons that enable users to navigate through the pages of data one page at a time, or to jump to the first or last page of data.

You can customize the appearance of the NextPreviousPagerField object by using the ButtonCssClass property to set the style of the buttons. You can also use the ButtonType property to choose the type of button that is displayed. The following table lists the available button types.

Button type

Description

Button

A Button control.

Image

An ImageButton control.

Link

A LinkButton control.

You can hide a NextPreviousPagerField object in a DataPager control by setting the Visible property to false. You can also hide the individual buttons (the first-page, previous-page, next-page, and last-page buttons) by setting the ShowFirstPageButton, ShowPreviousPageButton, ShowNextPageButton, and ShowLastPageButton properties to false.

The NextPreviousPagerField control enables you to specify custom text for each button by using the FirstPageText, PreviousPageText, NextPageText, and LastPageText properties.

When the ButtonType property is set to ButtonType.Image, you must provide the URL to an image that will be displayed for the button. You can set images individually for each button by setting the FirstPageImageUrl, PreviousPageImageUrl, NextPageImageUrl, and LastPageImageUrl properties.

When the ButtonType property is set to ButtonType.Image, the corresponding text property acts as the alternate text for the image. For example, the text that is specified by the FirstPageText property is displayed as the alternate text for the first-page image button. In browsers that support tooltips, this text is also displayed as a tooltip.

The following example shows how to use a NextPreviousPagerField object to page through data that is displayed in a ListView control.

Visual Basic
<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
  <head id="Head1" runat="server">
    <title>NextPreviousPagerField Example</title>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%#Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%#Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%#Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
        <Fields>
          <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </asp:SqlDataSource>

    </form>
  </body>
</html>
C#
<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
  <head id="Head1" runat="server">
    <title>NextPreviousPagerField Example</title>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%#Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%#Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%#Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
        <Fields>
          <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </asp:SqlDataSource>

    </form>
  </body>
</html>

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Bibliothèque de classes .NET Framework
NextPreviousPagerField, classe

Représente un champ qui affiche des contrôles de navigation dans un contrôle DataPager pour permettre aux utilisateurs de parcourir les données.

System..::.Object
  System.Web.UI.WebControls..::.DataPagerField
    System.Web.UI.WebControls..::.NextPreviousPagerField

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web.Extensions (dans System.Web.Extensions.dll)
Visual Basic
Public Class NextPreviousPagerField _
    Inherits DataPagerField
C#
public class NextPreviousPagerField : DataPagerField
VisualC++
public ref class NextPreviousPagerField : public DataPagerField
F#
type NextPreviousPagerField =  
    class
        inherit DataPagerField
    end

Le type NextPreviousPagerField expose les membres suivants.

  NomDescription
Méthode publiqueNextPreviousPagerFieldInitialise une nouvelle instance de la classe NextPreviousPagerField.
Début
  NomDescription
Propriété publiqueButtonCssClassObtient ou définit la classe de feuille de style en cascade (CSS) utilisée pour le rendu des boutons du champ du pagineur dans le navigateur.
Propriété publiqueButtonTypeObtient ou définit le type de bouton à afficher dans le champ du pagineur.
Propriété protégéeDataPagerObtient une référence au pagineur de données auquel l'objet DataPagerField est associé. (Hérité de DataPagerField.)
Propriété publiqueFirstPageImageUrlObtient ou définit l'URL d'une image affichée pour le bouton de première page.
Propriété publiqueFirstPageTextObtient ou définit le texte qui est affiché pour le bouton de première page.
Propriété protégéeIsTrackingViewStateObtient une valeur qui indique si l'objet DataPagerField suit les modifications apportées à son état d'affichage. (Hérité de DataPagerField.)
Propriété publiqueLastPageImageUrlObtient ou définit l'URL d'une image affichée pour le bouton de dernière page dans l'objet NextPreviousPagerField.
Propriété publiqueLastPageTextObtient ou définit le texte qui est affiché pour le bouton de dernière page.
Propriété publiqueNextPageImageUrlObtient ou définit l'URL d'une image affichée pour le bouton de page suivante dans l'objet NextPreviousPagerField.
Propriété publiqueNextPageTextObtient ou définit le texte qui est affiché pour le bouton de page suivante.
Propriété publiquePreviousPageImageUrlObtient ou définit l'URL d'une image affichée pour le bouton de page précédente dans l'objet NextPreviousPagerField.
Propriété publiquePreviousPageTextObtient ou définit le texte qui est affiché pour le bouton de page précédente.
Propriété protégéeQueryStringHandledObtient ou définit une valeur qui indique si le champ de chaîne de requête a été évalué. (Hérité de DataPagerField.)
Propriété protégéeQueryStringValueObtient la valeur du champ de chaîne de requête auprès de l'URL de la demande. (Hérité de DataPagerField.)
Propriété publiqueRenderDisabledButtonsAsLabelsObtient ou définit une valeur qui indique si les boutons désactivés sont rendus en tant que contrôles Label par l'objet NextPreviousPagerField.
Propriété publiqueRenderNonBreakingSpacesBetweenControlsObtient ou définit une valeur qui indique si les espaces insécables sont rendus entre les contrôles.
Propriété publiqueShowFirstPageButtonObtient ou définit une valeur qui indique si le bouton de première page est affiché dans un objet NextPreviousPagerField.
Propriété publiqueShowLastPageButtonObtient ou définit une valeur qui indique si le bouton de dernière page est affiché dans un objet NextPreviousPagerField.
Propriété publiqueShowNextPageButtonObtient ou définit une valeur qui indique si le bouton de page suivante est affiché dans un objet NextPreviousPagerField.
Propriété publiqueShowPreviousPageButtonObtient ou définit une valeur qui indique si le bouton de page précédente est affiché dans un objet NextPreviousPagerField.
Propriété protégéeViewStateObtient un dictionnaire d'informations d'état qui vous permet d'enregistrer et de restaurer l'état d'affichage d'un objet DataPagerField parmi plusieurs demandes pour la même page. (Hérité de DataPagerField.)
Propriété publiqueVisibleObtient ou définit une valeur indiquant si un champ du pagineur de données est restitué. (Hérité de DataPagerField.)
Début
  NomDescription
Méthode protégéeCloneFieldInfrastructure. Crée une copie de l'objet actuel dérivé de DataPagerField. (Hérité de DataPagerField.)
Méthode protégéeCopyPropertiesCopie les propriétés de l'objet NextPreviousPagerField actuel vers l'objet DataPagerField spécifié. (Substitue DataPagerField..::.CopyProperties(DataPagerField).)
Méthode publiqueCreateDataPagersCrée les contrôles d'interface utilisateur pour l'objet de champ du pagineur et les ajoute au conteneur spécifié. (Substitue DataPagerField..::.CreateDataPagers(DataPagerFieldItem, Int32, Int32, Int32, Int32).)
Méthode protégéeCreateFieldCrée et retourne une nouvelle instance de la classe NextPreviousPagerField. (Substitue DataPagerField..::.CreateField()()().)
Méthode publiqueEqualsDétermine si l'objet spécifié est égal à l'objet NextPreviousPagerField en cours. (Substitue Object..::.Equals(Object).)
Méthode protégéeFinalizeAutorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.)
Méthode publiqueGetHashCodeSert de fonction de hachage pour la classe NextPreviousPagerField. (Substitue Object..::.GetHashCode()()().)
Méthode protégéeGetQueryStringNavigateUrlCrée une URL qui contient un champ de chaîne de requête contenant le numéro de page spécifié. (Hérité de DataPagerField.)
Méthode publiqueGetTypeObtient le Type de l'instance actuelle. (Hérité de Object.)
Méthode publiqueHandleEventGère les événements qui se produisent dans le contrôle NextPreviousPagerField et exécute l'action appropriée. (Substitue DataPagerField..::.HandleEvent(CommandEventArgs).)
Méthode protégéeLoadViewStateRestaure des informations d'état de vue enregistrées précédemment. (Hérité de DataPagerField.)
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode protégéeOnFieldChangedDéclenche l'événement FieldChanged. (Hérité de DataPagerField.)
Méthode protégéeSaveViewStateEnregistre les modifications apportées à l'état de vue de l'objet DataPagerField. (Hérité de DataPagerField.)
Méthode publiqueToStringRetourne une chaîne qui représente l'objet actuel. (Hérité de Object.)
Méthode protégéeTrackViewStateL'objet DataPagerField effectue alors le suivi des modifications de son état d'affichage afin qu'elles puissent être stockées dans la propriété ViewState du contrôle et persister entre les demandes pour la même page. (Hérité de DataPagerField.)
Début
  NomDescription
Implémentation d'interface explicitePropriété privéeIStateManager..::.IsTrackingViewStateInfrastructure. Obtient une valeur qui indique si l'objet DataPagerField suit les modifications apportées à son état d'affichage. (Hérité de DataPagerField.)
Implémentation d'interface expliciteMéthode privéeIStateManager..::.LoadViewStateInfrastructure. Restaure des informations d'état de vue enregistrées précédemment. (Hérité de DataPagerField.)
Implémentation d'interface expliciteMéthode privéeIStateManager..::.SaveViewStateInfrastructure. Enregistre les modifications apportées à l'état de vue de l'objet DataPagerField. (Hérité de DataPagerField.)
Implémentation d'interface expliciteMéthode privéeIStateManager..::.TrackViewStateInfrastructure. L'objet DataPagerField effectue alors le suivi des modifications de son état d'affichage afin qu'elles puissent être stockées dans la propriété ViewState du contrôle et persister entre les demandes pour la même page. (Hérité de DataPagerField.)
Début

La classe NextPreviousPagerField représente un champ qui affiche des contrôles de navigation dans un contrôle DataPager. Ces contrôles de navigation peuvent être utilisés pour parcourir les données affichées par un contrôle qui implémente l'interface IPageableItemContainer, tel que le contrôle ListView.

La classe NextPreviousPagerField fournit des boutons qui permettent aux utilisateurs de parcourir les pages de données une par une, ou d'accéder à la première ou à la dernière page de données.

Vous pouvez personnaliser l'apparence de l'objet NextPreviousPagerField en utilisant la propriété ButtonCssClass pour définir le style des boutons. Vous pouvez également utiliser la propriété ButtonType pour choisir le type de bouton affiché. Le tableau suivant répertorie les types de bouton disponibles.

Type de bouton

Description

Button

un contrôle Button.

Image

Contrôle ImageButton.

Link

un contrôle LinkButton.

Vous pouvez masquer un objet NextPreviousPagerField dans un contrôle DataPager en affectant la valeur false à la propriété Visible. Vous pouvez également masquer les boutons individuels (boutons de première page, de page précédente, de page suivante et de dernière page) en affectant aux propriétés ShowFirstPageButton, ShowPreviousPageButton, ShowNextPageButton et ShowLastPageButton la valeur false.

Le contrôle NextPreviousPagerField vous permet de spécifier un texte personnalisé pour chaque bouton à l'aide des propriétés FirstPageText, PreviousPageText, NextPageText et LastPageText.

Lorsque la valeur de la propriété ButtonType est ButtonType.Image, vous devez fournir l'URL d'une image à afficher pour le bouton. Vous pouvez définir les images individuellement pour chaque bouton en définissant les propriétés FirstPageImageUrl, PreviousPageImageUrl, NextPageImageUrl et LastPageImageUrl.

Lorsque la propriété ButtonType a la valeur ButtonType.Image, la propriété Text correspondante agit en tant que texte de remplacement pour l'image. Par exemple, le texte spécifié par la propriété FirstPageText est affiché en tant que texte de remplacement pour le bouton d'image de première page. Les navigateurs prenant en charge la fonctionnalité d'info-bulle affichent ce texte sous forme d'info-bulle.

L'exemple suivant indique comment utiliser un objet NextPreviousPagerField pour parcourir les données affichées dans un contrôle ListView.

Visual Basic
<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
  <head id="Head1" runat="server">
    <title>NextPreviousPagerField Example</title>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%#Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%#Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%#Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
        <Fields>
          <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </asp:SqlDataSource>

    </form>
  </body>
</html>
C#
<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
  <head id="Head1" runat="server">
    <title>NextPreviousPagerField Example</title>
  </head>
  <body>
    <form id="form1" runat="server">

      <h3>NextPreviousPagerField Example</h3>

      <asp:ListView ID="ContactsListView" 
        DataSourceID="ContactsDataSource"
        runat="server">
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" runat="server" id="tblContacts">
            <tr id="itemPlaceholder" runat="server">
            </tr>
          </table>
        </LayoutTemplate>
        <ItemTemplate>
          <tr runat="server">
            <td>
              <asp:Label ID="ContactIDLabel" runat="server" Text='<%#Eval("ContactID") %>' />
            </td>
            <td>
              <asp:Label ID="FirstNameLabel" runat="server" Text='<%#Eval("FirstName") %>' />
            </td>
            <td>
              <asp:Label ID="LastNameLabel" runat="server" Text='<%#Eval("LastName") %>' />
            </td>
          </tr>
        </ItemTemplate>
      </asp:ListView>

      <asp:DataPager runat="server" ID="ContactsDataPager" PagedControlID="ContactsListView">
        <Fields>
          <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true" />
        </Fields>
      </asp:DataPager>

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->
      <asp:SqlDataSource ID="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [ContactID], [FirstName], [LastName] FROM Person.Contact">
      </asp:SqlDataSource>

    </form>
  </body>
</html>

.NET Framework

Pris en charge dans : 4, 3.5

Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2

Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Contenu de la communauté   Qu'est-ce que le Contenu de la communauté ?
Ajouter du contenu RSS  Annotations
Processing
© 2012 Microsoft. Tous droits réservés. Conditions d'utilisation | Marques | Confidentialité
Page view tracker