void btn_Login_Click(object sender, EventArgs e) { if (MemberManage.Validator(this.txtUserName.Text, this.txtPwd.Text)) { //管理员不能在这登录 bool isInAdmin = Roles.IsUserInRole(this.txtUserName.Text, "Admin"); if (isInAdmin) { this.ltMsg.Text = "用户名或密码错误!"; return; } Login(this.txtUserName.Text, this.txtPwd.Text); Response.Redirect("/"); } else { this.ltMsg.Text = "用户名或密码错误!"; } }
void btnLogin_Click(object sender, EventArgs e) { if (MemberManage.Validator(this.txtUserName.Text, this.txtUserPwd.Text)) { SiteMember sm = new SiteMember(this.txtUserName.Text); if (!sm.IsPass) { this.ltMsg.Text = "您还没有通过审核或帐号已禁用"; } else { Login(this.txtUserName.Text, this.txtUserPwd.Text); Response.Redirect(string.Format("{0}pagesadmin/index.aspx", ResolveUrl("~"))); } } else { this.ltMsg.Text = "用户名或密码错误!"; } }