Example #1
0
        protected void login_BTN_Click(object sender, EventArgs e)
        {
            CustomerUtility customer = new CustomerUtility();

            customer.userName = userName_TB.Text;
            customer.password = password_TB.Text;
            if (customer.checkPassword())
            {
                Session["user"]       = userName_TB.Text;
                message_LBL.Enabled   = true;
                message_LBL.Visible   = true;
                message_LBL.Text      = "Welcome back!";
                message_LBL.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "2; url=Home.aspx");
            }
            else
            {
                message_LBL.Enabled   = true;
                message_LBL.Visible   = true;
                message_LBL.Text      = "Username and password combination is not correct!";
                message_LBL.ForeColor = System.Drawing.Color.Red;
                resetLink_BTN.Visible = true;
                resetLink_BTN.Enabled = true;
            }
        }
Example #2
0
        protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            CustomerUtility c = new CustomerUtility();

            c.userName = TextBoxuser.Text;
            c.password = TextBoxPassword.Text;
            if (c.checkPassword())
            {
                Session["user"]        = TextBoxuser.Text;
                LabelMessage.Visible   = true;
                LabelMessage.Enabled   = true;
                LabelMessage.Text      = "Welcome back!!";
                LabelMessage.ForeColor = System.Drawing.Color.Red;
                Response.AddHeader("refresh", "3;url=Home.aspx");
            }
            else
            {
                LabelMessage.Visible             = true;
                LabelMessage.Enabled             = true;
                LabelMessage.Text                = "User or Password is  not correct";
                LinkButtonForgotpaswword.Enabled = true;
                LinkButtonForgotpaswword.Visible = true;
            }
        }