예제 #1
0
        protected void Login_Click(object sender, EventArgs e)
        {
            loginB.userName = UserName.Text;
            loginB.password = PassLog.Text;
            UserName.Text   = "";
            PassLog.Text    = "";
            int res = lb.CheckLogin(loginB);

            if (res == 0)
            {
                string script = "<script type=\"text/javascript\">alert('Incorrect username or password!!!');</script>";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);

                Response.Redirect("Home.aspx");
            }
            else
            {
                Session["userName"] = loginB.userName;
                Response.Redirect("Main.aspx");
            }
        }