PagerPosition Enumeração
Definição
Especifica a posição do pager para acessar várias páginas em um controle paginado.Specifies the position of the pager for accessing various pages within a paginated control.
public enum class PagerPosition
public enum PagerPosition
type PagerPosition =
Public Enum PagerPosition
- Herança
Campos
| Bottom | 0 | Um pager posicionado na parte inferior do controle.A pager positioned at the bottom of the control. |
| Top | 1 | Um pager posicionado na parte superior do controle.A pager positioned at the top of the control. |
| TopAndBottom | 2 | Pagers posicionados nas partes superior e inferior do controle.Pagers positioned at both the top and the bottom of the control. |
Exemplos
O exemplo de código a seguir demonstra como usar a PagerPosition enumeração para especificar que o pager deve ser exibido na parte inferior de um FormView controle.The following code example demonstrates how to use the PagerPosition enumeration to specify that the pager should be displayed at the bottom of a FormView control.
<%@ 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>FormView AllowPaging Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>FormView AllowPaging Example</h3>
<asp:formview id="EmployeeFormView"
datasourceid="EmployeeSource"
allowpaging="true"
datakeynames="EmployeeID"
runat="server">
<pagersettings mode="Numeric"
position="Bottom"/>
<pagerstyle backcolor="LightBlue"
horizontalalign="Center"/>
<itemtemplate>
<table>
<tr>
<td>
<asp:image id="EmployeeImage"
imageurl='<%# Eval("PhotoPath") %>'
alternatetext='<%# Eval("LastName") %>'
runat="server"/>
</td>
<td>
<h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>
<%# Eval("Title") %>
</td>
</tr>
</table>
</itemtemplate>
</asp:formview>
<!-- 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="EmployeeSource"
selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</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>FormView AllowPaging Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>FormView AllowPaging Example</h3>
<asp:formview id="EmployeeFormView"
datasourceid="EmployeeSource"
allowpaging="true"
datakeynames="EmployeeID"
runat="server">
<pagersettings mode="Numeric"
position="Bottom"/>
<pagerstyle backcolor="LightBlue"
horizontalalign="Center"/>
<itemtemplate>
<table>
<tr>
<td>
<asp:image id="EmployeeImage"
imageurl='<%# Eval("PhotoPath") %>'
alternatetext='<%# Eval("LastName") %>'
runat="server"/>
</td>
<td>
<h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>
<%# Eval("Title") %>
</td>
</tr>
</table>
</itemtemplate>
</asp:formview>
<!-- 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="EmployeeSource"
selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</form>
</body>
</html>
Comentários
Controles que dão suporte à paginação geralmente fornecem um conjunto de controles chamado pager que permite ao usuário navegar pelas páginas dentro do controle.Controls that support pagination often provide a set of controls called the pager that allows the user to navigate the pages within the control. A PagerPosition enumeração representa os diferentes locais em que o pager pode ser exibido.The PagerPosition enumeration represents the different locations where the pager can be displayed.