protected void LoginBtn_Click(object sender, EventArgs e) { BLL customer = new BLL(); string username = TxtBoxUserName.Text.Trim(); string password = Encrypter.EncryptText(TxtBoxPsswrd.Text.Trim()); customer.CustName = username; customer.Password = password; //check if user exists in the table then login the user if (bll.AuthenticateUser(customer)) { labelOutput.Text = "Login Done!"; labelOutput.ForeColor = System.Drawing.Color.Green; FormsAuthentication.RedirectFromLoginPage(username, false); } else { labelOutput.Text = "Login failed. Please try again."; labelOutput.ForeColor = System.Drawing.Color.Red; } }