我正在尝试使用 ASP 和 VB 级联下拉菜单
1st drop down --> Sex Type
> Male
> Female
2nd Drop Down -->Status
> Orphan
> Married
> UnMarried
> Divorced
> Widow
> Special Need
> Normal
现在,
如果从第一个下拉列表中选择男性,则从第二个下拉列表中选择(孤儿、特殊需要、已婚、未婚、离婚、寡妇和正常)
如果从第一个下拉列表中选择女性,则从第二个下拉列表中选择(孤儿、特殊需要和正常)
我正在使用实体从数据库中获取 drop dwons 的数据;
VB代码
context As New EGrantsModel.Entities
ddlSexType.DataSource = context.SEXTYPE
ddlSexType.DataValueField = "SEXTYPE"
ddlSexType.DataTextField = "SEXTYPE"
ddlSexType.DataBind()
ddlCitizenStatus.DataSource = context.CITIZENSTATUS
ddlCitizenStatus.DataValueField = "CITIZENSTATUSID"
ddlCitizenStatus.DataTextField = "CITIZENSTATUS"
ddlCitizenStatus.DataBind()
ASP 代码
<div class="labelinput">
<asp:Label ID="lblSexType" CssClass="lblwidth" runat="server" Text="">Sex Type</asp:Label>
<asp:DropDownList ID="ddlSexType" runat="server"/>
</div>
<div class="labelinput">
<asp:Label ID="lblCitizenStatus" CssClass="lblwidth" runat="server" Text="">Status</asp:Label>
<asp:DropDownList ID="ddlCitizenStatus" runat="server"/>
</div>
任何人都可以在这方面指导我。谢谢