private void RefreshView(int NewIndex) { try { int size = this.gv_Result.PageSize; string name = tb_Name.Text.Trim(); string sex = ddl_sex.SelectedValue; var ps = SpecialWorkBusiness.GetCommunications(size, name, sex); this.gv_Result.PageIndex = NewIndex; this.gv_Result.DataSource = new PagedCollection <SpecialWork>(ps, NewIndex); this.gv_Result.DataBind(); this.Label_Result.Text = ps.GetResultCount().ToString(); } catch { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "alter", "alert('数据加载错误!')", true); } }