protected void DropDownListClass_SelectedIndexChanged(object sender, EventArgs e) { string tenLop = (string)DropDownListClass.SelectedValue; GridViewSinhVien.DataSource = SinhVienAndPoint.getSinhVienAndPointByClassID(tenLop); GridViewSinhVien.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Admin"] == null) { return; } Admin a = (Admin)Session["Admin"]; LabelUserName.Text = a.MaGv1; if (!IsPostBack) { DropDownListClass.DataTextField = "TenLop"; DropDownListClass.DataValueField = "MaLop"; DropDownListClass.DataSource = Lop.getAllClass(); DropDownListClass.DataBind(); GridViewSinhVien.DataSource = SinhVien.getAllSinhVien(); GridViewSinhVien.DataBind(); DropDownListKhoa.DataTextField = "TenKhoa1"; DropDownListKhoa.DataValueField = "MaKhoa1"; DropDownListKhoa.DataSource = Khoa.GetKhoas(); DropDownListKhoa.DataBind(); } }