PagerPosition Enumeration

 

Specifies the position of the pager for accessing various pages within a paginated control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public enum PagerPosition

Member nameDescription
Bottom

A pager positioned at the bottom of the control.

Top

A pager positioned at the top of the control.

TopAndBottom

Pagers positioned at both the top and the bottom of the control.

Controls that support pagination often provide a set of controls called the pager that allows the user to navigate the pages within the control. The PagerPosition enumeration represents the different locations where the pager can be displayed.

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") %>&nbsp;<%# 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>

.NET Framework
Available since 1.1
Return to top
Show: