我已经发到外网来测试。先注册  接受考试规则  然后选择 科目一  点击开始答题  就会关闭了出题的页面。 本地的服务器正常    自己电脑浏览正常。  发布到外网 这里就不行了。
地址是。  点击我开始   www.ccmtv.cn/ExamOnLine/Login.aspx
是JS的原因还是什么原因——————

解决方案 »

  1.   

    首先说下啊,你这个注册有问题呢,我没有填用户名,他提示已经存在呢,我没有输密码,。离开确认密码的时候提示我成功呢。还有email,我貌似只能输入11位 ,我就输入了yezixian200 这个是email,居然提示我注册成功了,我忍了。。
    http://www.ccmtv.cn/ExamOnLine/student/studentexam.aspx 这个页面,我如果不点同意规则,他alert出请同意,页面样式就变了,你应该用的Response.Write(alert());然后去参加考试题,答了1题就交卷了。。
      

  2.   

    这是我点击开始开始考试的代码
       protected void Button2_Click(object sender, EventArgs e)
        {
            string StuID = Session["ID"].ToString();//考生的编号
            string StuKC = ddlKm.SelectedItem.Text;//选择的考试科目
            SqlConnection conn = BaseClass.DBCon();
            conn.Open();
            SqlCommand cmd = new SqlCommand("select count(*) from tb_Score where StudentID='" + StuID + "' and LessonName='" + StuKC + "'", conn);
            int i = Convert.ToInt32(cmd.ExecuteScalar());
            if (i > 0)
            {
                MessageBox.Show("你已经参加过此科目的考试了");
            }
            else
            {            cmd = new SqlCommand("select count(*) from tb_test where testCourse='" + StuKC + "'", conn);
                int N = Convert.ToInt32(cmd.ExecuteScalar());            if (N > 0)
                {
                    //cmd = new SqlCommand("insert into tb_Score(StudentID,LessonName,StudentName) values('" + StuID + "','" + StuKC + "','" + lblName.Text + "')", conn);
                    //cmd.ExecuteNonQuery();
                    //conn.Close();
                    Session["KM"] = StuKC;
                    Session["falg"] = 1;
                    Response.Write("<script>window.open('StartExam.aspx','newwindow','status=1,scrollbars=1,resizable=1')</script>");
                    Response.Write("<script>window.opener=null;window.close();</script>");                //Response.Redirect("StartExam.aspx"); 我换成这样的跳转方式也是一样的关闭了页面。
                }
                else
                {
                    MessageBox.Show("此科目没有考试题");
                    return;
                }
            }
        }
      

  3.   

    MessageBox.show这个在你的程序中起作用吗?
      

  4.   

    楼主你的是使用window.open打开窗口的,很多的游览器对这个都是有阻止的,也就是你的新的窗口被阻止了,旧的窗口被关闭了,比如chrome中用window。open时,地址栏的右边会出现红叉
      

  5.   

    作用是起的  只是 会样式变化。 我都全部改变成了  ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('此科目没有考试题!');", true);
                    return;  这样的方式    
      

  6.   


     Response.Redirect("StartExam.aspx"); 我换成这样的跳转方式也是一样的关闭了页面。
      

  7.   

    新开了一个Firefox7和IE9窗口,测试都通过
    没问题。
      

  8.   

    我的IE6也是没问题的。看到你的实现是Response.Redirect("StartExam.aspx"); 
    这种方式不会有问题。如果有问题的话,就是这台特定的客户端机器有问题,你可以换个机器。