日期:2014-05-17 浏览次数:20481 次
public partial class queryNoAppCardDept : System.Web.UI.Page { public string HangSh = "0";//行数 public string YeSh = "0";//页数 public static string s = ""; DataView dv = new DataView(); public Int32 CurrentPageIndex; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { } } protected void btnQuery_Click(object sender, EventArgs e) { string strSql = ""; AspNetPager1.CurrentPageIndex = 1; if (ddlApartment.SelectedValue.Length == 2) { s = "where .................1"; } else { s = "where .................2"; } int curPage = 0; if (Request.QueryString["page"] != null) { curPage = Convert.ToInt32(Request.QueryString["page"]); } else { curPage = 1; } CurrentPageIndex = curPage; strSql = "select * from table1 " + s + " order by personno"; dv = dataOperate.getDataView(strSql, curPage, "20", out YeSh, out HangSh); AspNetPager1.RecordCount = Convert.ToInt32(HangSh); bindData(); } void bindData() { Repeater1.DataSource = dv; Repeater1.DataBind(); } protected void AspNetPager1_PageChanged(object src, EventArgs e) { string strSql = ""; int curPage = 0; AspNetPager1.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]); if (Request.QueryString["page"] != null) { curPage = Convert.ToInt32(Request.QueryString["page"]); } else { curPage = 1; } CurrentPageIndex = curPage; if (s == "") { //xxxxxxxx } else { strSql = "select from table1 " + s + " order by personno"; dv = dataOperate.getDataView(strSql, curPage, "20", out YeSh, out HangSh); AspNetPager1.RecordCount = Convert.ToInt32(HangSh); AspNetPager1.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]); bindData(); } } }
public partial class queryNoAppCardDept : System.Web.UI.Page { public string HangSh = "0";//行数 public string YeSh = "0";//页数 public static string s = ""; DataView dv = new DataView(); public Int32 CurrentPageIndex; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { } } protected void btnQuery_Click(object sender, EventArgs e) { bindData(); } void bindData() { string strSql = ""; AspNetPager1.CurrentPageIndex = 1; if (ddlApartment.SelectedValue.Length == 2) { s = "where .................1"; } else { s = "where .................2"; } int curPage = 0; if (Request.QueryString["page"] != null)