我想級聯使用ASP和VB下拉級聯問題:如何級聯兩個下拉
1st drop down --> Sex Type
> Male
> Female
2nd Drop Down -->Status
> Orphan
> Married
> UnMarried
> Divorced
> Widow
> Special Need
> Normal
現在,
如果男性從第一個下拉選擇菜單,然後選擇下拉菜單(孤兒,特別極品,已婚,未婚,離婚,從第2下拉
如果女,然後從第二個下拉
選擇(孤兒,特殊需要和正常)我得到來自數據庫的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>
任何一個可以指導我在這方面。謝謝
非常感謝CoderRoller的熱情和慷慨的回覆,它確實幫助我,只是告訴我如何解決我的問題,我的答案在下面,但我接受你的答案。 – AbdulAziz 2012-07-29 22:02:38