I am trying to cascade dropdowns using ASP and VB
1st drop down --> Sex Type
> Male
> Female
2nd Drop Down -->Status
> Orphan
> Married
> UnMarried
> Divorced
> Widow
> Special Need
> Normal
Now,
If Male selected from 1st drop down, then select (Orphan, Special Need, Married, UnMarried, Divorced, Widow and Normal) from 2nd Drop Down
And if Female selected from 1st drop down, then select (Orphan, Special Need and Normal) from 2nd Drop Down
I am getting data of drop dwons from database using Entities;
VB Code
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 Code
<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>
Can any one guide me in this regards. Thank you
Check this:
If you have any questions about the code please let me know.