日期:2012-05-03  浏览次数:20369 次

PageChange.ascx
================================================================
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="PageChange.ascx.cs" Inherits="Ex_Test.PageChange" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<FONT face="宋体">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="98%" border="0">
<TR>
<TD align="right"><asp:linkbutton id="FirstPage" runat="server">[首 页]</asp:linkbutton> 
<asp:linkbutton id="PrevPage" runat="server">[上一页]</asp:linkbutton> 
<asp:linkbutton id="NextPage" runat="server">[下一页]</asp:linkbutton> 
<asp:linkbutton id="LastPage" runat="server">[末 页]</asp:linkbutton> 
<asp:literal id="Literal1" runat="server" Text="转到第"></asp:literal><asp:textbox id="NewPageIndex" runat="server" Width="31px"></asp:textbox><asp:literal id="Literal2" runat="server" Text="页"></asp:literal> 
<asp:button id="NewPageGo" runat="server" Text="Go"></asp:button> </TD>
</TR>
</TABLE>
</FONT>
=======================================================================


PageChange.ascx.cs
===================================================================
namespace Ex_Test
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

/// <summary>
/// PageChange 的摘要说明。
/// </summary>
public abstract class PageChange : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Button NewPageGo;
protected System.Web.UI.WebControls.Literal Literal2;
protected System.Web.UI.WebControls.TextBox NewPageIndex;
protected System.Web.UI.WebControls.Literal Literal1;
protected System.Web.UI.WebControls.LinkButton LastPage;
protected System.Web.UI.WebControls.LinkButton NextPage;
protected System.Web.UI.WebControls.LinkButton PrevPage;
protected System.Web.UI.WebControls.LinkButton FirstPage;
protected int currentpage;
protected int pagesize;
protected string proc;
protected System.Web.UI.WebControls.DataGrid datagrid;


public int _CurrentPage
{
get
{
return currentpage;
}
set
{
currentpage = value;
}
}

public int _pageSize
{
get
{
return pagesize;
}
set
{
pagesize = value;
}
}

public string _proc
{
get
{
return proc;
}
set
{
proc = value;
}
}

public DataGrid _datagrid
{
get
{
return datagrid;
}
set
{
datagrid = value;
}
}