当我登录失败时,它不会像我期望的那样更改登录标签
我也尝试过使用消息框,但也无法使用
string strPassword;
string strUserName;
strUserName = (myReader["Username"].ToString());
strPassword = (myReader["Password"].ToString());
if (Username == strUserName && Password == strPassword)
{
Session["Username"] = textUserName.Text;
Response.Redirect("homepage.aspx");
} else {
lblLogin.Text = "Login failed , invalid Username or password";
lblLogin.ForeColor = System.Drawing.Color.Red;
}
我希望登录失败后可以显示标签以显示我的消息