当前位置: 代码迷 >> ASP.NET >> Response.Write("<script>alert('')</script>"); 不起作用,该怎么处理
  详细解决方案

Response.Write("<script>alert('')</script>"); 不起作用,该怎么处理

热度:6271   发布时间:2013-02-25 00:00:00.0
Response.Write("<script>alert('')</script>"); 不起作用
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand cmd = new SqlCommand("select * from userlogin where useremail='" + this.Login1.UserName + "' and pwd = '" + System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.Login1.Password.Trim(), "MD5") + "';", conn);

            try
            {
                conn.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    //Session["userAuth"] = modeluser.Purview;
                    Session.Add("userName", null);
                    Session["userName"] = dr["username"];
                    Session["userID"] = dr["useremail"];
                    //将已验证身份的用户重定向回最初请求的 URL。
                    FormsAuthentication.RedirectFromLoginPage(this.Login1.UserName.Trim(), false);
                    if (Convert.ToInt32(dr["validate"]) == 1)
                    {
                         Response.Redirect(@"~/temp/MakeCourse.aspx", false);
                    }
                    else 
                    {
                        Response.Write("<script>alert('对不起,只有经过管理员审批才能制作!')</script>");
                        
                    }
                }
                else
                {                    
  相关解决方案