方便 样式好把握
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();
}
}