コード例 #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                clsBSAdmin obj = new clsBSAdmin();
                clsAdmin clss = new clsAdmin();
                clss = obj.GetByUserPassword(this.txtUserName.Text, this.txtPassword.Text);
                if (clss != null)
                {
                    Session["AdminID"] = clss.Id;
                    Response.Redirect("~/Admin/Default.aspx");
                }
                else
                {
                    this.lblMessage.Text = "Đăng nhập không thành công";
                }
            }
            catch (Exception)
            {

                throw;
            }
        }