protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //登录验证 adminUser.GetLoginState(); //登录信息 HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["admin"]; if (cookie != null) { Application["adminname"] = (string)cookie.Values["adminname"]; Application["adminType"] = (string)cookie.Values["adminType"]; } else if (Session["adminname"] != null) { Application["adminname"] = (string)Session["adminname"]; Application["adminType"] = (string)Session["adminType"]; } string strparentId = this.Request.QueryString["parentId"] ?? ""; //上级栏目ID classid = strparentId; // string where = "select * from C_admin_role where role_type>=" + Convert.ToInt32(Application["adminType"]) + " order by id desc"; this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.PageSize = 10; this.AspNetPager1.RecordCount = blladmin_role.GetRecordCount(""); this.RepeaterDataBind(where); bool bladd = adminUser.setpurview("角色管理", "add"); bool blDelete = adminUser.setpurview("角色管理", "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } } }