日期:2014-02-09  浏览次数:20374 次


<!--前台页面-->
 
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Try1.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>WebForm1</title>
  <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
  <meta content="C#" name="CODE_LANGUAGE">
  <meta content="JavaScript" name="vs_defaultClientScript">
  <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
 </HEAD>
 <body>
  <form id="Form1" method="post" runat="server">
   <P><FONT face="宋体"></FONT> </P>
   <P>
    <asp:DataGrid id="DataGrid1" runat="server" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px"
     BackColor="White" CellPadding="4" AllowPaging="True" PageSize="5" AllowSorting="True">
     <SelectedItemStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedItemStyle>
     <ItemStyle ForeColor="#003399" BackColor="White"></ItemStyle>
     <HeaderStyle Font-Bold="True" ForeColor="#CCCCFF" BackColor="#003399"></HeaderStyle>
     <FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
     <PagerStyle HorizontalAlign="Left" ForeColor="#003399" BackColor="#99CCCC" PageButtonCount="6"
      Mode="NumericPages"></PagerStyle>
    </asp:DataGrid></P>
   <P>
    <asp:Panel id="Panel1" runat="server">
     <asp:LinkButton id="btnPrevious" runat="server" CommandName="Previous"><=Previous</asp:LinkButton>
     <FONT face="宋体">          
      <asp:LinkButton id="btnNext" runat="server" CommandName="Next">Next=></asp:LinkButton>
      <asp:TextBox id="txtIndex" runat="server" Width="24px" Columns="2" MaxLength="2"></asp:TextBox>
      <asp:Button id="btnGo" runat="server" BackColor="Gainsboro" BorderWidth="1px" BorderStyle="Solid"
       BorderColor="Silver" Text="Go!"></asp:Button>
      <asp:Label id="lblError" runat="server" ForeColor="Red" Visible="False">No that page!</asp:Label></FONT>
    </asp:Panel></P>
   <FONT face="宋体"></FONT>
   <asp:Panel id="pnlIndex" runat="server">Panel</asp:Panel>
  </form>
 </body>
</HTML>



//-------后台代码---------------------------------
//-------使用的数据库是sqlserver2000示例数据库------
using System;
using System.Collections;
using System