ASP.NET GridView学习之一2011-12-18 博客园 孟冬伊Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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>无标题页</title></head><body>  <form id="form1" runat="server">  <div>    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"      BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"      CellPadding="3" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="5">      <PagerSettings FirstPageImageUrl="~/Images/First.gif" FirstPageText="|&lt;" LastPageImageUrl="~/Images/Last.gif"        LastPageText="&gt;|" Mode="NumericFirstLast" NextPageImageUrl="~/Images/Next.gif"        PageButtonCount="5" PreviousPageImageUrl="~/Images/Previous.gif" />      <FooterStyle BackColor="White" ForeColor="#000066" />      <Columns>        <asp:BoundField DataField="ClientName" HeaderText="姓名" SortExpression="Name" />        <asp:BoundField DataField="AddressStr" HeaderText="地址" SortExpression="Address" />        <asp:BoundField DataField="PostCode" HeaderText="邮编" SortExpression="PostCode" />      </Columns>      <RowStyle ForeColor="#000066" />      <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />      <PagerStyle BackColor="#FFC080" BorderColor="Blue" Font-Bold="True" ForeColor="#000066"        HorizontalAlign="Left" />      <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />    </asp:GridView>  </div>  </form></body></html>