PagerPosition 列挙型
定義
改ページ位置が自動調整されるコントロール内の、ページャーの位置を指定します。ページャーは、複数のページにアクセスするために使用されます。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
- 継承
フィールド
Bottom | 0 | コントロールの下部にページャーが配置されます。A pager positioned at the bottom of the control. |
Top | 1 | コントロールの上部にページャーが配置されます。A pager positioned at the top of the control. |
TopAndBottom | 2 | コントロールの上部と下部の両方にページャーが配置されます。Pagers positioned at both the top and the bottom of the control. |
例
次のコード例は、列挙体を使用して、 PagerPosition ページャーをコントロールの下部に表示するように指定する方法を示して FormView います。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>
注釈
改ページをサポートするコントロールは、ページャーと呼ばれるコントロールのセットを提供し、ユーザーがコントロール内のページを移動できるようにします。Controls that support pagination often provide a set of controls called the pager that allows the user to navigate the pages within the control. PagerPosition列挙体は、ページャーを表示できるさまざまな場所を表します。The PagerPosition enumeration represents the different locations where the pager can be displayed.