protected void btnLogin_Click(object sender, EventArgs e)
{
if (lbYzmMsg.Text == "验证码错误,请重试")
{
Response.Write("<script>alert('验证码错误,请重新输入!')</script>");
return;
}
DataTable table = SqlHelper.ExecuteDataTable("select * from T_User where UserName=@UserName",
new SqlParameter("@UserName", txtUserName.Text));
if (table.Rows.Count >= 1)
{
DataRow row = table.Rows[0];
if (txtPassword.Text == (string)row["Password"])
{
Response.Redirect("Customers.aspx");
}
else if (txtPassword.Text != (string)row["Password"])
{
Response.Write("<script>alert('密码错误!')</script>");
return;
}
}
else
{
Response.Write("<script>alert('用户名不存在!')</script>");
return;
}
}
为啥这段代码跳不到Customers.aspx这个页面呢,我把那些数据都单独查,都是查的到的,但就是整合起来的时候就直接不运行这段代码了,急急急,求大神!