我有以下代码来检查有效用户:
protected void Login_LoginError(object sender, EventArgs e) {
//See if this user exists in the database
MembershipUser userinfo = Membership.GetUser(Login.UserName);
if (userinfo == null || !userinfo.IsApproved || userinfo.IsLockedOut) {
//The user entered an invalid username/password...
Login.FailureText = "Invalid User/Password";
} else {
Login.FailureText = string.Empty;
}
}
当用户的密码错误时,此代码不会显示失败文本,我需要代码隐藏逻辑来验证用户和密码!任何建议表示赞赏。