private void databind(string sort) { int SParentCode = int.Parse(Request.QueryString["sid"].ToString()); PagedDataSource pd = new PagedDataSource(); pd.DataSource = bll.GetList(SParentCode, sort);//第一级菜单 // pd.AllowPaging = true; //pd.PageSize = 15; //pd.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; //if (pd.Count>0) //{ // this.lblCurrentPage.Text = "共" + AspNetPager1.RecordCount + "条记录,当前第" + (pd.CurrentPageIndex + 1).ToString() + "页,共" + pd.PageCount.ToString() + "页,每页" + pd.PageSize + "条纪录"; //} foreach (Tz888.Model.dp.SysMenuTab mo in bll.GetList(SParentCode, sort)) { ViewState["parentCode"] = mo.SParentCode; break; } if (ViewState["parentCode"] == null) { ViewState["parentCode"] = SParentCode; } GridView1.DataSource = pd; GridView1.DataBind(); }
private void databind(string sort) { int SParentCode = 0; PagedDataSource pd = new PagedDataSource(); pd.DataSource = bll.GetList(SParentCode, sort);//第一级菜单 //pd.AllowPaging = true; pd.PageSize = 25; //pd.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; //if (pd.Count>0) //{ // this.lblCurrentPage.Text = "共" + AspNetPager1.RecordCount + "条记录,当前第" + (pd.CurrentPageIndex + 1).ToString() + "页,共" + pd.PageCount.ToString() + "页,每页" + pd.PageSize + "条纪录"; //} foreach (Tz888.Model.dp.SysMenuTab mo in bll.GetList(SParentCode, sort)) { ViewState["parentCode"] = mo.SParentCode; break; } if (ViewState["parentCode"].ToString() == "" || ViewState["parentCode"].ToString() == null) { ViewState["parentCode"] = SParentCode; } //Response.Write("<script>alert('" + ViewState["parentCode"].ToString() + "')</script>"); GridView1.DataSource = pd; GridView1.DataBind(); }
protected DataSet GetDataList() { if (AppCache.IsExist("SysMenuList")) { ds = (DataSet)AppCache.Get("SysMenuList"); } else { ds = bll.GetList(""); AppCache.AddCache("SysMenuList", ds); } return(ds); }