62,046
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.SetNewListPage();
bindcity();
}
}
private void bindcity()
{
this.ddl_city.DataSource = zphcity.GetAllList();
this.ddl_city.DataTextField = "city_name";
this.ddl_city.DataValueField = "city_id";
this.ddl_city.DataBind();
}
protected void SetNewListPage()
{
int count = 0;
this.rp_list.DataSource = com_bll.GetList(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, "id", false, "cid=" + cid, out count);
this.rp_list.DataBind();
this.AspNetPager1.RecordCount = count;
AspNetPager1.CustomInfoHTML = "<font color='#000'>记录总数:</font><font color=\"blue\"><b>" + AspNetPager1.RecordCount.ToString() + " </b></font>";
AspNetPager1.CustomInfoHTML += "<font color='#000'>总页数:</font><font color=\"blue\"><b>" + AspNetPager1.PageCount.ToString() + " </b></font>";
AspNetPager1.CustomInfoHTML += "<font color='#000'>当前页:</font><font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + " </b></font>";
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
this.SetNewListPage();
}
protected void btn_query_Click(object sender, EventArgs e)
{
cid = this.ddl_city.SelectedItem.Value;
this.SetNewListPage();
}