


















平时都觉得分页是个麻烦事 这次在网上下了aspnetpage.dll这个分页控件真不错
方便 样式好把握
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class cn_a : System.Web.UI.Page
{
private int sRecordCount;
info info = new info();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindData();
this.AspNetPager1.RecordCount = sRecordCount;
}
}
private void BindData()
{
DataSet ds = info.GetDataList("Info", "*","InfoID",this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, ref sRecordCount, 0, "0=0");
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
BindData();
}
}
简单的代码解决问题
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。