Guest User

Untitled

a guest
Jul 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <div>
  2. <asp:DropDownList runat="server" ID="GroepSelect" AutoPostBack="true" AppendDataBoundItems="true" />
  3. <asp:DropDownList runat="server" ID="VakSelect" AutoPostBack="true" AppendDataBoundItems="true" />
  4. </div>
  5.  
  6. protected void Page_Load(object sender, EventArgs e) {
  7. Database db = new Database();
  8. if (!IsPostBack) {
  9. GroepSelect.DataSource = GenereerDummyGroepen(); // returns a List<ListItem>
  10. GroepSelect.DataTextField = "Text";
  11. GroepSelect.DataValueField = "Value";
  12. GroepSelect.DataBind();
  13. GroepSelect.SelectedValue = "1";
  14.  
  15. VakSelect.DataSource = db.GetVakken(); // returns a List<Vak>
  16. VakSelect.DataTextField = "Omschrijving";
  17. VakSelect.DataValueField = "Id";
  18. VakSelect.DataBind();
  19. VakSelect.SelectedValue = "1";
  20. }
  21.  
  22. // Use the SelectedValue to determine which data to get out of the database
  23. Medewerkers = db.GetMedewerkers(int.Parse(GroepSelect.SelectedValue));
  24. Opdracht = db.GetOpdrachten(int.Parse(VakSelect.SelectedValue)).First();
  25. Resultaten = db.GetResultaten(Opdracht.Id, int.Parse(GroepSelect.SelectedValue));
  26.  
  27. GenereerTabel();
  28. }
Add Comment
Please, Sign In to add comment