private void GetDataForBind() { int pageindex, pagesize, pagecount, recordcount; pageindex = string.IsNullOrEmpty(Context.Request.QueryString["pageindex"]) ? 1 : Convert.ToInt32(Context.Request.QueryString["pageindex"]); pagesize = string.IsNullOrEmpty(Context.Request.QueryString["pagesize"]) ? 3 : Convert.ToInt32(Context.Request.QueryString["pagesize"]); UserHandlerBLL bll = new UserHandlerBLL(); List <TblArea> list = bll.GetData(pageindex, pagesize, out pagecount, out recordcount); this.Repeater1.DataSource = list; this.Repeater1.DataBind(); this.Literal1.Text = PagerHelper.strPage(recordcount, pagesize, pagecount, pageindex, "WebForm1.aspx?pagesize=" + pagesize + "&pageindex="); }
private void LoadContacts() { int pageindex, pagesize, pagecount, recordcount; string pIndex = Context.Request.QueryString["pageindex"]; pageindex = string.IsNullOrEmpty(pIndex) ? 1 : int.Parse(pIndex); pagesize = String.IsNullOrEmpty(Context.Request.QueryString["pagesize"]) ? 3 : int.Parse(Context.Request.QueryString["pagesize"]); UserHandlerBLL bll = new UserHandlerBLL(); List <TblArea> area = bll.GetData(pageindex, pagesize, out pagecount, out recordcount); this.Repeater1.DataSource = area; this.Repeater1.DataBind(); this.Literal1.Text = PagerHelper.strPage(recordcount, pagesize, pagecount, pageindex, "Repeater.aspx?pagesize=" + pagesize + "&pageindex="); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int pageindex, pagesize, pagecount, recordcount; string pIndex = context.Request.QueryString["pageindex"]; string pSize = context.Request.QueryString["pagesize"]; pageindex = String.IsNullOrEmpty(pIndex) ? 1 : int.Parse(pIndex); pagesize = String.IsNullOrEmpty(pSize) ? 3 : int.Parse(pSize); UserHandlerBLL bll = new UserHandlerBLL(); List <TblArea> list = bll.GetData(pageindex, pagesize, out pagecount, out recordcount); string strIndex = PagerHelper.strPage(recordcount, pagesize, pagecount, pageindex, "UsersHandler.ashx?pagesize=" + pagesize + "&pageindex="); var sendData = new { _pageData = list, _pageIndex = strIndex }; //序列化为json格式 JavaScriptSerializer jss = new JavaScriptSerializer(); string strJson = jss.Serialize(sendData); context.Response.Clear(); context.Response.Write(strJson); context.Response.End(); }