protected void btn_login_Click(object sender, EventArgs e) { string loginEmail = txt_email.Text; string loginPassword = txt_password.Text; string confirmPassword = DBconnection.getPassword(loginEmail); if (loginPassword.Equals(confirmPassword)) { Session["loginData"] = DBconnection.getUser(loginEmail); Response.Write("<script>alert('You are logged in')</script>"); Response.Redirect(Request.Url.ToString()); } else { Response.Write("<script>alert('Details do not match.')</script>"); } }