public class AdminPage : System.Web.UI.Page
    {
        /// <summary>
        /// 管理网站用户名
        /// </summary>
        public string superId = string.Empty;
        /// <summary>
        /// 用户名
        /// </summary>
        public string userId = string.Empty;
        public AdminPage()
        {
            this.Load += new EventHandler(AdminPage_Load);
        }     
        public void AdminPage_Load(object sender , EventArgs e)
        {
            CheckLogin();
            userId = Session["UserId"] != null ? Session["UserId"].ToString() : string.Empty;
            superId = Session["Id"] != null ? Session["Id"].ToString() : string.Empty;
        }
        public void CheckLogin()
        {
            if (Session["UserId"] == null || Session["UserId"].ToString() == string.Empty)
                Response.Redirect("~/admin/login.aspx");
        }
    }

相关文章:

  • 2022-12-23
  • 2022-03-10
  • 2021-04-14
  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-12-02
猜你喜欢
  • 2021-10-25
  • 2021-10-15
  • 2022-12-23
  • 2021-06-27
  • 2021-05-23
  • 2021-12-31
相关资源
相似解决方案