using System; using System.Collections.Generic; using System.Data; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace iNethinkCMS.Web.admin.extend { public partial class KHZL : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Bind(); if (!string.IsNullOrEmpty(Request.QueryString["Delete"])) { BLL.BLL_Immediateuse bll = new BLL.BLL_Immediateuse(); string id = Request.QueryString["Delete"]; id = id.Substring(0, id.Length - 1); if (bll.DeleteList(id)) { ClientScript.RegisterStartupScript(this.GetType(), "tishi", ""); } else { ClientScript.RegisterStartupScript(this.GetType(), "tishi", ""); } } } } void Bind() { BLL.BLL_Immediateuse bll = new BLL.BLL_Immediateuse(); DataTable dt = bll.GetList("1=1").Tables[0]; PagedDataSource pds = new PagedDataSource(); AspNetPager1.RecordCount = dt.Rows.Count; pds = new PagedDataSource(); pds.AllowPaging = true; pds.PageSize = AspNetPager1.PageSize; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.DataSource = dt.DefaultView; rptList.DataSource = pds; rptList.DataBind(); } protected void AspNetPager1_PageChanged(object sender, EventArgs e) { // Bind(); } } }