在我的页面中,有3个下拉菜单。先前选择后从下拉菜单中删除列表
下拉1:用于存储从CarTab检索在数据库(SQL)
下拉2汽车模型:用于存储用户名
下拉3:用于存储板NUM
的所有的功能下拉菜单中,有相互关联的。让我们说,如果管理员选择本田威驰在下拉1,下拉2将显示用户名,他们以前只预订了本田威驰。然后在下拉菜单3中,它会显示汽车的车牌号码。例如,在CarTab中,有6辆本田威驰,当然这些车型有不同的车牌号。对?所以,下拉3,会显示给管理员所选车的车牌号码。
管理员选择本田Vios下拉1,下一个下拉2将显示选择本田vios和管理员选择用户A的用户列表,板号为SGH 12BC。然后管理员点击保存按钮并将其保存到数据库中的新表中。
<td>Car Model</td>
<td class="style21">
<asp:DropDownList ID="DropDownList1" runat="server" Height="42px" Width="146px"
AutoPostBack="True">
<asp:ListItem>Please Choose</asp:ListItem>
<asp:ListItem>Honda Vios</asp:ListItem>
<asp:ListItem>Honda Civic</asp:ListItem>
<asp:ListItem>Honda City</asp:ListItem>
<asp:ListItem>Honda Jazz</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style18">
User</td>
<td class="style19">
<asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Username"
DataValueField="Username" Height="36px" Width="137px" AutoPostBack="True">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="SELECT [Username] FROM [Rsvp] WHERE ([Model] = @Model)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="Model"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td class="style16">
Plate
</td>
<td class="style17">
<asp:DropDownList ID="DropDownList3" runat="server"
DataSourceID="SqlDataSource2" DataTextField="Plate" DataValueField="Plate"
Height="45px" Width="141px" AutoPostBack="True">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="SELECT [Plate] FROM [CarTab] WHERE ([Model] = @Model)">
</asp:SqlDataSource
这里有一个问题:
如何删除用户名和管理员选择的车牌号码?意思是,当管理员登录时,本田vios列表和车牌号码的用户名不会再出现。我需要帮助。请指导我。
借口? – TheGeekZn
我要求先前选择的值(用户名和牌照号码)不再可用 –
您的意思是这些值不再适用于当前会话或应该永久禁用? – Agent007