//only redirects if form data is valid, and form data matches the hardcoded values in this page protected void setToTYPage(object sender, EventArgs e) { BL.userAccountManagementAdminBL Uam = new BL.userAccountManagementAdminBL(); if (Uam.loginUser(textBoxEmail.Text, textBoxPassword.Text)) { labelError.Visible = true; labelError.Text = "login success!"; } else { //this was a test Response.Redirect("RegistrationPage.aspx"); } // If the page is valid and the data matches, go to success page //if ((Page.IsValid) && IsMatching()) //{ // Response.Redirect("sucessLogin.aspx"); //} }
protected void validationOnLoginBtn(object sender, EventArgs e) { if (IsValidEmail(txbUsername.Text) == false) { LbUsernamVal.Visible = true; } else { LbUsernamVal.Visible = false; BL.userAccountManagementAdminBL Uam = new BL.userAccountManagementAdminBL(); if (Uam.loginUser(txbUsername.Text, txbPassword.Text)) { btnLogin.Text = "logout"; } else { btnLogin.Text = "error"; } } }