コード例 #1
0
        protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            CustomerUtil customer = new CustomerUtil();

            customer.userName = TextBoxUserName.Text;
            customer.password = TextBoxPassword.Text;
            if (customer.checkPassword())
            {
                Session["user"]        = TextBoxUserName.Text;
                LabelMessage.Enabled   = true;
                LabelMessage.Visible   = true;
                LabelMessage.Text      = "Welcome Back!";
                LabelMessage.ForeColor = System.Drawing.Color.White;
                Response.AddHeader("refresh", "4; url=Home.aspx");
            }
            else
            {
                LabelMessage.Enabled             = true;
                LabelMessage.Visible             = true;
                LabelMessage.Text                = "Invalid Username or Password";
                LabelMessage.ForeColor           = System.Drawing.Color.Red;
                LinkButtonForgotPassword.Enabled = true;
                LinkButtonForgotPassword.Visible = true;
            }
        }