1
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultDataGrid_02.aspx.cs" Inherits="数据分页DEMO_DefaultDataGrid" %>
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5
<html xmlns="http://www.w3.org/1999/xhtml" >
6
<head runat="server">
7
<title>无标题页</title>
8
</head>
9
<body>
10
<form id="form1" runat="server">
11
<div>
12
<asp:LinkButton id="lbtnFirst" Font-Size="Smaller" Runat="server" OnClick="lbtnFirst_Click">首頁</asp:LinkButton>
13
<asp:LinkButton id="lbtnBack" Font-Size="Smaller" Runat="server" OnClick="lbtnBack_Click">上頁</asp:LinkButton>
14
<asp:LinkButton id="lbtnNext" Font-Size="Smaller" Runat="server" OnClick="lbtnNext_Click">下頁</asp:LinkButton>
15
<asp:LinkButton id="lbtnLast" Font-Size="Smaller" Runat="server" OnClick="lbtnLast_Click">尾頁</asp:LinkButton>
16
<asp:Label id="Label1" Font-Size="Smaller" runat="server">当前页:</asp:Label>
17
<asp:Label id="lblCurrentPage" Font-Size="Smaller" runat="server">1</asp:Label>
18
<asp:Label id="Label2" Font-Size="Smaller" runat="server">总页:</asp:Label>
19
<asp:Label id="lblPageCount" Font-Size="Smaller" runat="server">200</asp:Label>
20
<asp:Label id="Label3" Font-Size="Smaller" runat="server">跳转:</asp:Label>
21
<asp:TextBox id="txtToPage" Font-Size="Smaller" runat="server" Width="88px"></asp:TextBox>
22
<asp:Button id="btnToPage" Font-Size="Smaller" runat="server" Text="go" OnClick="btnToPage_Click"></asp:Button>
23
24
<asp:DataGrid id="DataGrid1" runat="server" CellPadding="4" ForeColor="#333333"
25
GridLines="None" Font-Bold="False" Font-Italic="False"
26
Font-Names="幼圆" Font-Overline="False" Font-Size="Smaller"
27
Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left">
28
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
29
<EditItemStyle BackColor="#7C6F57" />
30
<SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
31
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
32
<AlternatingItemStyle BackColor="White" />
33
<ItemStyle BackColor="#E3EAEB" />
34
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
35
</asp:DataGrid>
36
37
38
</div>
39
</form>
40
</body>
41
</html>
42
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
using System;
2
using System.Data;
3
using System.Configuration;
4
using System.Collections;
5
using System.Web;
6
using System.Web.Security;
7
using System.Web.UI;
8
using System.Web.UI.WebControls;
9
using System.Web.UI.WebControls.WebParts;
10
using System.Web.UI.HtmlControls;
11
using System.Data.SqlClient;
12
using System.Text;
13
public partial class 数据分页DEMO_DefaultDataGrid : System.Web.UI.Page
14
2
3
4
5
6
7
8
9
10
11
12
13
14