Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div>
- <asp:DropDownList runat="server" ID="GroepSelect" AutoPostBack="true" AppendDataBoundItems="true" />
- <asp:DropDownList runat="server" ID="VakSelect" AutoPostBack="true" AppendDataBoundItems="true" />
- </div>
- protected void Page_Load(object sender, EventArgs e) {
- Database db = new Database();
- if (!IsPostBack) {
- GroepSelect.DataSource = GenereerDummyGroepen(); // returns a List<ListItem>
- GroepSelect.DataTextField = "Text";
- GroepSelect.DataValueField = "Value";
- GroepSelect.DataBind();
- GroepSelect.SelectedValue = "1";
- VakSelect.DataSource = db.GetVakken(); // returns a List<Vak>
- VakSelect.DataTextField = "Omschrijving";
- VakSelect.DataValueField = "Id";
- VakSelect.DataBind();
- VakSelect.SelectedValue = "1";
- }
- // Use the SelectedValue to determine which data to get out of the database
- Medewerkers = db.GetMedewerkers(int.Parse(GroepSelect.SelectedValue));
- Opdracht = db.GetOpdrachten(int.Parse(VakSelect.SelectedValue)).First();
- Resultaten = db.GetResultaten(Opdracht.Id, int.Parse(GroepSelect.SelectedValue));
- GenereerTabel();
- }
Add Comment
Please, Sign In to add comment