<table>
<tr>
<td>
<asp:Label ID="lblstarttime" runat="server" Text="StartTime :" Style="font-size: 80%; font-weight: bold">
</asp:Label>
</td>
<td>
<asp:DropDownList ID="DdlStartTime" runat="server" CssClass="dropdown" Style="font-size: small" OnSelectedIndexChanged="DdlStartTime_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td style="width: 10%"></td>
<td>
<asp:Label ID="lblEndTime" runat="server" Text="EndTime :" Style="font-size: 70%; font-weight: bold">
</asp:Label>
</td>
<td>
<asp:DropDownList ID="DdlEndTime" runat="server" CssClass="dropdown" Style="font-size: small">
</asp:DropDownList>
</td>
<td>
<asp:Button ID="btnsub" runat="server" Text="Submit" CssClass="btn btn-info" OnClick="btnsub_Click" />
</td>
</tr>
</table>
protected void DdlStartTime_SelectedIndexChanged(object sender, EventArgs e)
{
ListItem selectedItem = DdlStartTime.SelectedItem;
foreach (ListItem item in DdlEndTime.Items)
{
if (item.Value == selectedItem.Value)
{
DdlEndTime.Items.Remove(item);
}
}
}
当我在StartTime
中选择DdlStartTime
时,endTime
项应该大于第二个下拉列表。
在这里,我无法得到我想要的确切内容..任何人都可以帮助我吗?