自定义DataGrid分页设置
先定义ASPX页面,注意AllowCustomPaging要设为"False":<body>
<form id="DictList" method="post" runat="server">
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing="0" width="100%" border="1">
<TR>
<td bgColor="#c0c000">信息:<FONT face="Arial" color="#ffffff">数据维护</FONT>
</td>
</TR>
<tr>
<td><FONT face="宋体"></FONT></td>
</tr>
<tr>
<td><asp:datagrid id="MyDataGrid" runat="server" Width="100%" PageSize="20" AllowPaging="True" AutoGenerateColumns="False" DataKeyField="FDictid">
<SelectedItemStyle BackColor="#FFC080"></SelectedItemStyle>
<HeaderStyle BackColor="#C0C000"></HeaderStyle>
<Columns>
<asp:ButtonColumn Text="选择" HeaderText="选择" CommandName="Select">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="8%"></HeaderStyle>
<ItemStyle Font-Bold="True" HorizontalAlign="Center"></ItemStyle>
</asp:ButtonColumn>
<asp:BoundColumn DataField="FDictID" SortExpression="FDictID asc" HeaderText="标识号">
<HeaderStyle Width="15%"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="FNameCn" SortExpression="FNameCn asc" HeaderText="名称">
<HeaderStyle Width="15%"></HeaderStyle>
</asp:BoundColumn>
补充:asp教程,高级应用