asp.net 语法问题
我用vs2010做asp.net 写了一段代码如下
protected void dl_Click(object sender, ImageClickEventArgs e)
{
Conn = new SqlConnection((string)Application["sql_zty"]);
Conn.Open();
string xm = Projectname.Text.ToString().Trim();
string zh = Username.Text.ToString().Trim();
string mm = password.Text.ToString().Trim();
string sql_str = "";
if (zh == "")
{
Response.Write("<script>alert('请输入登陆帐号!');history.back();</script>");
Response.End();
}
else if (mm == "")
{
Response.Write("<script>alert('请输入密码!');history.back();</script>");
Response.End();
}
else if (xm == "")
{
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "友情提示!", "confirm('您确定不登入项目吗?')", true);
sql_str = "select * from Users where Account='" + zh + "'";
Myadapter = new SqlDataAdapter(sql_str, Conn);
Myds = new DataSet();
Myadapter.Fill(Myds, "Users");
if (Myds.Tables["Users"].Rows.Count <= 0)
{
Response.Write("<script>alert('当前用户不存在!');history.back();</script>");
}
else
{
string upass = Myds.Tables["users"].Rows[0]["password"].ToString().Trim();
if (Comm.ExecuteScalar().ToString().Trim() == mm)
{
string name = Myds.Tables["users"].Rows[0]["name"].ToString().Trim();
string userid = Myds.Tables["users"].Rows[0]["id"].ToString().Trim();
Session["name"] = name;
Session["userid"] = userid;
Response.Redirect("Manage/index.aspx");
}
else
{
Response.Write("<script>alert('用户密码输入错误!');history.back();</script>");
Response.End();
}
}
Comm.Dispose();
Conn.Close();
Conn.Dispose();
……
其他都正常的,但是当xm==0后的那个提示框跳不出来 我是要提示框上选择是的时候就登入进去了