protected void btnUserLogin_Click(object sender, EventArgs e) { User user = new User(); string userName = this.txtName.Text.Trim(); string password = this.password.Text.Trim(); bool loginResult = user.UserLogin(userName,password); if (loginResult) { Response.Write(" <script language=javascript> window.alert( '登录成功 '); </script> "); } else { Response.Write(" <script language=javascript> window.alert( '登录失败 '); </script> "); } }