Hmm...det var vist mig, der var lidt for hurtig. Men koden lignede dog. Her er den rigtige:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="TurStatistikMaster.master.cs" Inherits="TurStatistikMaster" EnableViewState="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="font-size: 12pt; background-color: #ccffff;">
<form id="form1" runat="server">
<div>
<table border="0" style="width: 100%">
<tr>
<td colspan=10 style="text-align: center">
<strong><span style="font-size: 14pt">
Statistik over ture</span></strong></td>
</tr>
<tr>
<td style="height: 21px">
År:
</td>
<td style="height: 21px">
Statistiktype:
</td>
<td style="height: 21px">
Fra:</td>
<td style="height: 21px">
Til:</td>
<td colspan=1 style="height: 21px">
</td>
</tr>
<tr>
<td style="width: 100px; height: 24px;">
<asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="Period"
DataTextField="F_Year" DataValueField="F_Year" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged"
Width="100px">
</asp:DropDownList>
<!-- indsat manuelt -->
<asp:AccessDataSource ID="Period" runat="server" DataFile="~/App_Data/LøbeDatabase.mdb"
SelectCommand='SELECT DISTINCT F_Year FROM [T_Period] WHERE F_Id=[@ID]'>
<SelectParameters>
<asp:SessionParameter SessionField="Id" Name="ID" />
</SelectParameters>
</asp:AccessDataSource>
<!-- hertil indsat-->
<!--
<asp:AccessDataSource ID="Period2" runat="server" DataFile="~/App_Data/LøbeDatabase.mdb"
SelectCommand='SELECT [F_Year] FROM [T_Period]'>
</asp:AccessDataSource>
--> </td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" DataSourceID="AccessDataSource2" DataTextField="F_Type" DataValueField="F_Type">
<asp:ListItem Value="1">Uge</asp:ListItem>
<asp:ListItem Value="2">Måned</asp:ListItem>
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/LøbeDatabase.mdb"
SelectCommand="SELECT DISTINCT F_Type FROM T_Period"></asp:AccessDataSource>
</td>
<td style="width: 100px; height: 24px;">
<asp:DropDownList ID="DropDownList2" runat="server" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged" DataSourceID="AccessDataSource3" DataTextField="F_Start" DataValueField="F_Start">
</asp:DropDownList> <br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList2"
ErrorMessage="*">Vælg starttidspunkt</asp:RequiredFieldValidator><asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="~/App_Data/LøbeDatabase.mdb"
SelectCommand="SELECT [F_Start] FROM [T_Period] WHERE ([F_Id] = ?)">
<SelectParameters>
<asp:FormParameter FormField="id" Name="F_Id" Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
</td>
<td style="width: 100px; height: 24px;">
<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="AccessDataSource4" DataTextField="F_End" DataValueField="F_End">
</asp:DropDownList> <br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="DropDownList3"
ErrorMessage="*">Vælg starttidspunkt</asp:RequiredFieldValidator>
<asp:AccessDataSource ID="AccessDataSource4" runat="server" DataFile="~/App_Data/LøbeDatabase.mdb"
SelectCommand="SELECT [F_End] FROM [T_Period]"></asp:AccessDataSource>
</td>
<td colspan=1 style="width: 157px; height: 24px;">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Height="14px" Width="168px" />
<asp:Button ID="Vis" runat="server" OnClick="Vis_Click" Text="Vis" />
</td>
</tr>
</table>
</div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</form>
</body>
</html>
Og ja, der bruges adskillige datasources.
Når jeg kører siden, så er der ikke nogle værdier i dropdownboxen. 'Id' angives i codebehind til den side, som implementerer masterpagen.