Esempio n. 1
0
        public void Button1_Click(object sender, EventArgs e)
        {
            ConsoleApplication1.Program check = new ConsoleApplication1.Program();
            string password = PasswordBox.Text;
            string player   = UserNameTextBox.Text;
            int    x        = check.QueryIfUserNameAndPasswordExists(password, player);

            if (x == 1)
            {
                Session["UserName"] = UserNameTextBox.Text;
                Session["Password"] = PasswordBox.Text;
                Response.Redirect("~/Default.aspx");
            }

            else if (x == 0)
            {
                //Response.Redirect("~/UserLogin.aspx");
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Wrong Password, Try again !');", true);
            }

            else if (x == 2)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('User not found, please signup');", true);
            }
        }