我已经发到外网来测试。先注册 接受考试规则 然后选择 科目一 点击开始答题 就会关闭了出题的页面。 本地的服务器正常 自己电脑浏览正常。 发布到外网 这里就不行了。
地址是。 点击我开始 www.ccmtv.cn/ExamOnLine/Login.aspx
是JS的原因还是什么原因——————
地址是。 点击我开始 www.ccmtv.cn/ExamOnLine/Login.aspx
是JS的原因还是什么原因——————
http://www.ccmtv.cn/ExamOnLine/student/studentexam.aspx 这个页面,我如果不点同意规则,他alert出请同意,页面样式就变了,你应该用的Response.Write(alert());然后去参加考试题,答了1题就交卷了。。
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;
}
}
}
return; 这样的方式
Response.Redirect("StartExam.aspx"); 我换成这样的跳转方式也是一样的关闭了页面。
没问题。
这种方式不会有问题。如果有问题的话,就是这台特定的客户端机器有问题,你可以换个机器。