protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dataconn.ecDropDownList(ddlLesson, "select * from Course", "c_name", "c_id"); dataconn.ecDropDownList(ddlQueName, "select * from TaoTi where c_id='" + ddlLesson.SelectedValue + "' and PaperState='" + 1 + "'", "PaperName", "PaperID"); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { dataconn.ecDropDownList(DropDownList1, "select * from province", "p_name", "p_name"); GetDropDownList(); Label7.Visible = false; Label8.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["User_Name"] == null || Session["User_Row"].ToString() != "Teacher") { Response.Write("<script>alert('非法登录!')</script>"); Response.Write("<script language=javascript>top.location.href='../Login.aspx'</script>"); } else { preview_div.Style.Add("display", "none");//不显示 db.ecDropDownList(ddlCourse, "select * from Course", "c_name", "c_id"); db.ecDropDownList(DropDownList5, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList6, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList7, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList8, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList9, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList10, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList11, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); db.ecDropDownList(DropDownList12, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); } } Rscore(); double num = Convert.ToDouble(Label21.Text); }
protected void Page_Load(object sender, EventArgs e) { ST_check_Login(); Session["SelLession"] = this.ddlSelLess.SelectedItem; Session["SelTitle"] = this.ddlSelQue.SelectedItem; if (Page.IsPostBack == false) { dataconn.ecDropDownList(ddlSelLess, "select * from tb_Lesson", "Name", "ID"); GetDropDownList(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)//判断页面是否首次加载 { //调用ecDropDownList方法,绑定下拉列表数据 dataconn.ecDropDownList(ddlProfession, "select * from tb_Profession", "Name", "id"); GetDropDownList(); } this.Label5.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (Session["User_Name"] == null || Session["User_Row"].ToString() != "Teacher") { Response.Write("<script>alert('非法登录!')</script>"); Response.Write("<script language=javascript>top.location.href='../Login.aspx'</script>"); } if (!IsPostBack) { db.ecDropDownList(ddlCourse, "select * from Course", "c_name", "c_id"); //初始化考试科目下拉列表框 } db.ecDropDownList(DropDownList5, "select ID,Name+'-'+Chapter as Chapter from Chapter", "Chapter", "ID"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["User_Name"] == null || Session["User_Row"].ToString() != "Student") { Response.Write("<script>alert('非法登录!')</script>"); Response.Write("<script language=javascript>top.location.href='../Login.aspx'</script>"); } else { dataconn.ecDropDownList(ddlLesson, "select * from Course", "c_name", "c_id"); dataconn.ecDropDownList(ddlQueName, "select * from TaoTi where c_id='" + ddlLesson.SelectedValue + "' and PaperState='" + 1 + "'", "PaperName", "PaperID"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dataconn.ecDropDownList(ddlLesson, "select * from tb_Lesson", "Name", "id"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { db.ecDropDownList(ddlCourse, "select * from Course where teacher_id='" + Session["ID"] + "'", "c_name", "c_id"); //初始化考试科目下拉列表框 } }
protected void InitData() { int multiProblemID = int.Parse(Request["ID"].ToString()); //取出传递过来的试题编号 MultiProblem multiproblem = new MultiProblem(); //创建单选题对象 if (multiproblem.LoadData(multiProblemID)) //如果取出题目信息,分别放在相应控件显示 { db.ecDropDownList(ddlCourse, "select *from Course where c_id=(select c_id from MultiProblem where ID='" + multiProblemID + " ')", "c_name", "c_id"); txtTitle.Text = multiproblem.Title; txtAnswerA.Text = multiproblem.AnswerA; txtAnswerB.Text = multiproblem.AnswerB; txtAnswerC.Text = multiproblem.AnswerC; txtAnswerD.Text = multiproblem.AnswerD; string answer = multiproblem.Answer.ToString(); SqlConnection cn = db.getcon(); cn.Open(); string sqlstr1 = "select Answer from MultiProblem where ID='" + Request["ID"].ToString() + "'"; SqlCommand cmd1 = new SqlCommand(sqlstr1, cn); Label1.Text = cmd1.ExecuteScalar().ToString(); } else //查询出错,给出提示 { Response.Write("<script>alert('加载数据错误!');</script>"); Response.Write("<script>window.location.href='ChangeDuoXuan'</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //调用公共类中的ecDropDownList方法 dataconn.ecDropDownList(ddlProfession, "select * from tb_Profession", "Name", "ID"); Label1.Visible = false; Label2.Visible = false; Label3.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { db.ecDropDownList(ddlCourse, "select * from Course where teacher_id='" + Session["ID"] + "'", "c_name", "c_id"); } ImageButton2.Visible = false; Rscore(); double num = Convert.ToDouble(Label21.Text); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dataconn.ecDropDownList(ddlProfession, "select * from tb_Profession", "Name", "id"); SqlConnection con = dataconn.getcon(); con.Open(); SqlDataAdapter mydataadapter = new SqlDataAdapter("select * from tb_Lesson where ID=" + Request["id"], con); DataSet mydataset = new DataSet(); mydataadapter.Fill(mydataset, "tb_lesson"); DataRowView rowview = mydataset.Tables["tb_lesson"].DefaultView[0]; this.txtLessName.Text = Convert.ToString(rowview["Name"]); ddlProfession.Text = Convert.ToString(rowview["ofProfession"]); con.Close(); } }
public void InitData() { int judgeProblemID = int.Parse(Request["ID"].ToString()); //取出传递过来的试题编号 JudgeProblem judgeproblem = new JudgeProblem(); //创建判断题对象 if (judgeproblem.LoadData(judgeProblemID)) //如果取出题目信息,分别放在相应控件显示 { db.ecDropDownList(ddlCourse, "select * from Course where c_id=(select c_id from JudgeProblem where ID='" + judgeProblemID + "' )", "c_name", "c_id"); txtTitle.Text = judgeproblem.Title; SqlConnection cn = db.getcon(); cn.Open(); string sqlstr1 = "select Answer from JudgeProblem where ID='" + Request["ID"].ToString() + "'"; SqlCommand cmd1 = new SqlCommand(sqlstr1, cn); Label1.Text = cmd1.ExecuteScalar().ToString(); } else //查询出错,给出提示 { Response.Write("<script>alert('加载数据错误!');</script>"); Response.Write("<script>window.location.href='ChangePanDuan.aspx'</script>"); } }
protected void InitData() { int SingleProblemID = int.Parse(Request["ID"].ToString()); //取出传递过来的试题编号 SingleProblem singleproblem = new SingleProblem(); //创建单选题对象 if (singleproblem.LoadData(SingleProblemID)) //如果取出题目信息,分别放在相应控件显示 { db.ecDropDownList(ddlCourse, "select * from Course where c_id=(select c_id from SingleProblem where ID='" + SingleProblemID + " ')", "c_name", "c_id"); txtTitle.Text = singleproblem.Title; txtAnswerA.Text = singleproblem.AnswerA; txtAnswerB.Text = singleproblem.AnswerB; txtAnswerC.Text = singleproblem.AnswerC; txtAnswerD.Text = singleproblem.AnswerD; ddlAnswer.SelectedItem.Text = singleproblem.Answer; } else //查询出错,给出提示 { Response.Write("<script>alert('加载数据错误!');</script>"); Response.Write("<script>window.location.href='ChangeDanXuan.aspx'</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)//判断页面是否首次加载 { //调用公共类中的ecDropDownList方法,将考生所学专业绑定到下拉列表框中 dataconn.ecDropDownList(ddlLesson, "select * from tb_Lesson", "Name", "id"); //调用公共类中的getcon方法,创建一个新的数据库连接 SqlConnection con = dataconn.getcon(); //定义并初始化一个数据适配器 SqlDataAdapter mydataadapter = new SqlDataAdapter("select * from tb_TaoTi where id=" + Request["id"], con); //创建一个DataSet数据集 DataSet mydataset = new DataSet(); //将数据适配器中的数据填充到数据集mydataset中 mydataadapter.Fill(mydataset, "tb_TaoTi"); //在mydataset数据集中创建tb_TaoTi的默认视图 DataRowView rowview = mydataset.Tables["tb_TaoTi"].DefaultView[0]; //将输入的套题名称转换成字符串 this.txtQueName.Text = Convert.ToString(rowview["Name"]); ddlLesson.Text = Convert.ToString(rowview["LessonID"]); //关闭数据库连接 con.Close(); } }