此分頁方式與傳統ASP分頁方式相仿.
DataGridPage.aspx
<%@ Page language="c#" Codebehind="DataGridPage.aspx.cs" AutoEventWireup="false" Inherits="netCRM.DataGridPage" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>DataGridPage</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server" AlternatingItemStyle-BackColor="#eeeeee" HeaderStyle-BackColor="#aaaadd"
Font-Size="8pt" Font-Name="Verdana" CellPadding="3" BorderWidth="1px" BorderColor="Black"
PagerStyle-HorizontalAlign="Right" PagerStyle-Mode="NumericPages"
PageSize="5" Font-Names="Verdana" Width="100%">
<AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
<HeaderStyle BackColor="#AAAADD"></HeaderStyle>
<PagerStyle HorizontalAlign="Right" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
</form>
<TABLE cellSpacing="0" cellPadding="1" width="100%" bgColor="#aaaadd" border="0">
<TBODY>
<TR>
<TD>
<TABLE cellSpacing="0" cellPadding="4" width="100%" bgColor="#fef8e2" border="0">
<TBODY>
<TR>
<TD class="M" noWrap align="center"><asp:Literal id="Literal1" runat="server"></asp:Literal></TD>
</TR>
<TR>
<TD class="C" noWrap align="center"><asp:Literal id="Literal2" runat="server"></asp:Literal></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</body>
</HTML>