using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
public partial class sqlPager_Default : System.Web.UI.Page { BLL.Test test = new BLL.Test(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { AspNetPager1.RecordCount = Convert.ToInt32(test.getTotal());//此属性保存总记录数.. Bind(); } } private void Bind() { this.gvSql.DataSource = test.getPagesData(Convert.ToInt32(AspNetPager1.PageSize), AspNetPager1.CurrentPageIndex - 1); this.gvSql.DataBind(); } protected void AspNetPager1_PageChanged(object sender, EventArgs e) { Bind(); } }