Example #1
0
        protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            CustomerUtil check = new CustomerUtil();

            check.UserName = TextBoxUserName.Text;
            check.Password = TextBoxPassword.Text;
            if (check.CheckUserExist() && check.CheckPassword())
            {
                Session["user"]        = TextBoxUserName.Text;
                LabelMessage.Visible   = true;
                LabelMessage.Text      = "Welcome Back!";
                LabelMessage.ForeColor = Color.Red;

                Response.AddHeader("refresh", "4; url=Home.aspx");
            }
            else
            {
                LabelMessage.Visible            = true;
                LabelMessage.Text               = "Your userName and password are not correct!";
                LabelMessage.ForeColor          = Color.Red;
                LinkButtonResetPassowrd.Enabled = true;
                LinkButtonResetPassowrd.Visible = true;
            }   //close else
        }