protected void Page_Load(object sender, EventArgs e) { try { if (Session["sys_PageCount"] != null) { pageSize = Convert.ToInt32(Session["sys_PageCount"].ToString()); pager.PageSize = pageSize; } if (Session["pager_ShowPageIndex"] != null) { pager.ShowPageIndex = Convert.ToBoolean(Session["pager_ShowPageIndex"].ToString()); } if (!IsPostBack) { totalCount = objUser.GetRowCount(filter); pager.RecordCount = totalCount; GridDataBind(); } else { pageCount = Convert.ToInt32(ViewState["pageCount"]); pageIndex = Convert.ToInt32(ViewState["pageIndex"]); totalCount = Convert.ToInt32(ViewState["totalCount"]); filter = ViewState["filter"].ToString(); OrderByFields = ViewState["OrderByFields"].ToString(); totalCount = objUser.GetRowCount(filter); GridDataBind(); } } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } }