Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin admin = (Admin)Session["admin"];

            if (admin == null)
            {
                Response.Redirect("adminlogin.aspx");
            }
            else if (admin.type == 2)
            {
                div_main.InnerHtml = "<br><div class='alert alert-danger' role='alert'>非创建者类型管理员无法对管理员进行操作,请联系网站Admin。</div>";
            }
            if (Request["id"] != null)
            {
                AdminTableAdapter ta_admin = new AdminTableAdapter();
                DataTable         dt_admin = ta_admin.GetAdminById(Convert.ToInt32(Request["id"]));
                if (dt_admin.Rows.Count > 0 && !IsPostBack)
                {
                    txt_name.Text = dt_admin.Rows[0]["name"].ToString();
                    txt_psw.Focus();
                }
            }
        }