程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> ASP.NET >> 關於ASP.NET >> ASP.NET GridView學習之一

ASP.NET GridView學習之一

編輯:關於ASP.NET

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="|&amp;lt;" LastPageImageUrl="~/Images/Last.gif"
        LastPageText="&amp;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>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved