一个ASP.Net的DataGrid分页控件,在Oracle数据库下,每次只取当前页的数据,不使用存储过程。
写的不算好,仅供参考ASP.Net的DataGrid分页控件,在Oraclejavascript:window.open(this.src);" style="cursor:pointer;"/>(大型网站数据库平台)数据库下,每次只取当前页的数据,不使用存储过程。 src="http://www.cncms.com.cn/edu/UploadPic/2007-12/2007121593128947.gif">。
javascript:window.open(this.src);" style="cursor:pointer;"/>GridPager.ascx:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="GridPager.ascx.cs" Inherits="Test.BaseClass.GridPager" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%><?xml(标准化越来越近了):namespace prefix = asp /><asp:linkbutton id=lbtnPre style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="..." Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage1 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="1" Visible="False" Enabled="False" Font-Size="Small">1</asp:linkbutton> <asp:linkbutton id=lbtnPage2 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="2" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage3 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="3" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage4 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="4" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage5 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="5" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage6 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="6" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage7 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="7" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage8 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="8" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage9 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="9" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnPage10 style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="10" Visible="False"></asp:linkbutton><asp:linkbutton id=lbtnNext style="BORDER-RIGHT: white 2px solid; BORDER-LEFT: white 1px solid" runat="server" Text="..." Visible="False"></asp:linkbutton>
///////////////////////////////////////////////////////////////////////////////////////
javascript:window.open(this.src);" style="cursor:pointer;"/>GridPager.ascx.cs:
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
namespace Test.BaseClass
{
public class GridPager : System.Web.UI.UserControl
{
#region 类变量
protected System.Web.UI.WebControls.LinkButton lbtnNext;
protected System.Web.UI.WebControls.LinkButton lbtnPage10;
protected System.Web.UI.WebControls.LinkButton lbtnPage9;
protected System.Web.UI.WebControls.LinkButton lbtnPage8;