protected void Page_Load(object sender, EventArgs e) { user.Email = Request.QueryString["Email"].ToString(); user.Matkhau = Request.QueryString["Pass"].ToString(); DataTable dt = new DataTable(); dt = bus.getUser(user); dataList1.DataSource = dt; dataList1.DataBind(); ID = Int32.Parse(dt.Rows[0]["Id_User"].ToString()); txtHoTen.Text = dt.Rows[0]["HoTen"].ToString(); cfEmail.Text = dt.Rows[0]["Email"].ToString(); cfDiaChi.Text = dt.Rows[0]["DiaChi"].ToString(); cfSDT.Text = dt.Rows[0]["SDT"].ToString(); cfCMND.Text = dt.Rows[0]["CMND"].ToString(); }
protected void Login_Click(object sender, EventArgs e) { user.Email = LoginEmail.Text; user.Matkhau = LoginPassword.Text; DataTable dt = new DataTable(); dt = UserBus.getUser(user); if (dt.Rows.Count == 1) { Session["UserId"] = dt.Rows[0]["Id_User"]; Session["HoTen"] = dt.Rows[0]["HoTen"]; Session["Email"] = dt.Rows[0]["Email"]; string sEmail = LoginEmail.Text; string sPass = LoginPassword.Text; Response.Redirect("Backend/TrangCaNhan.aspx?Email=" + sEmail + "&Pass="******"<script>alert('Sai tài khoản hoặc mật khẩu')</script>"); } }