protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dataconn.bindinfostring(GridView1, "select * from Student order by ID DESC", "ID"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dataconn.bindinfostring(GridView1, "select * from student_score where ID='" + Session["ID"] + "' ", "ID"); } }
protected void Page_Load(object sender, EventArgs e) { ImageButton4.Attributes.Add("onclick", "javascript:return window.confirm('您确定要删除选中项吗?')"); if (!IsPostBack) { dataconn.bindinfostring(GridView1, "select * from Student order by ID DESC", "ID"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["ID"] == null) { Response.Write("<script>alert('非法登录!');location='../Index.aspx'</script>"); } else { dataconn.bindinfostring(gvQueInfo, "select * from JudgeProblem where c_id in(select c_id from Course where teacher_id='" + Session["ID"] + "')order by ID DESC", "ID"); } } }
protected void Page_Load(object sender, EventArgs e) { ImageButton4.Attributes.Add("onclick", "javascript:return window.confirm('您确定要删除选中项吗?')"); if (!IsPostBack) { if (Session["ID"] == null) { Response.Write("<script>alert('非法登录!');location='../Index.aspx'</script>"); } else { dataconn.bindinfostring(GridView1, "select * from Course where teacher_id='" + Session["ID"] + "'", "c_name"); } } }
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.bindinfostring(GridView1, "select * from student_score where ID='" + Session["ID"] + "' ", "ID"); } } }
//搜索 protected void ImageButton1_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { dataconn.bindinfostring(GridView1, "select * from Admin order by ID DESC", "ID"); } else { dataconn.bind(GridView1, "select * from Admin where " + DropDownList1.SelectedValue.Trim() + " Like '%" + TextBox1.Text + "%'"); } //查询数据记录 SqlConnection cn = dataconn.getcon(); cn.Open(); string sqlstr1 = "select count(*) from Admin where " + DropDownList1.SelectedValue.Trim() + " Like'%" + TextBox1.Text + "%'"; SqlCommand cmd1 = new SqlCommand(sqlstr1, cn); Label5.Text = cmd1.ExecuteScalar().ToString(); }
protected void Page_Load(object sender, EventArgs e) { Button4.Attributes.Add("onclick", "javascript:return window.confirm('您确定要删除吗?')"); if (!IsPostBack) { /*验证是否登陆了系统*/ if (Session["User_Row"] != "Admin") { Response.Write("<script>top.location.href='../404.html';</script>"); return; } dataconn.bindinfostring(GridView1, "select * from Major order by ID DESC", "ID"); //查询数据 SqlConnection cn = dataconn.getcon(); cn.Open(); string sqlstr1 = "select count(*) from Major"; SqlCommand cmd1 = new SqlCommand(sqlstr1, cn); Label5.Text = cmd1.ExecuteScalar().ToString(); } }