Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:38:05+00:00 2026-06-08T16:38:05+00:00

I am trying to cascade dropdowns using ASP and VB 1st drop down –>

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:38:06+00:00Added an answer on June 8, 2026 at 4:38 pm

    Check this:

    Public Class WebForm4
        Inherits System.Web.UI.Page
    
        Private Sub CitizenBind(ByVal strSexType As String)
    
            Dim lstCitizenStatus As New List(Of CitizenStatus)
    
            With lstCitizenStatus
                .Add(New CitizenStatus("1", "Orphan"))
                .Add(New CitizenStatus("2", "Married"))
                .Add(New CitizenStatus("3", "UnMarried"))
                .Add(New CitizenStatus("4", "Divorced"))
                .Add(New CitizenStatus("5", "Widow"))
                .Add(New CitizenStatus("6", "Special Need"))
                .Add(New CitizenStatus("7", "Normal"))
            End With
    
            Me.ddlCitizenStatus.Items.Clear()
    
            With Me.ddlCitizenStatus
                .DataSource = lstCitizenStatus
                .DataValueField = "CitizenStatusId"
                .DataTextField = "CitizenStatusT"
                .DataBind()
            End With
    
            If strSexType.Contains("F") Then
    
                Dim lstCitizenStatusRemove As New List(Of CitizenStatus)
                With lstCitizenStatusRemove
                    .Add(New CitizenStatus("2", "Married"))
                    .Add(New CitizenStatus("3", "UnMarried"))
                    .Add(New CitizenStatus("4", "Divorced"))
                    .Add(New CitizenStatus("5", "Widow"))
                End With
    
                For Each lstCS As CitizenStatus In lstCitizenStatusRemove
                    Me.ddlCitizenStatus.Items.Remove(New ListItem(lstCS.CitizenStatusT.ToString(), lstCS.CitizenStatusId.ToString()))
                Next
    
            End If
    
        End Sub
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            If Not Page.IsPostBack Then
    
                Dim lstSexType As New List(Of SexType)
                lstSexType.Add(New SexType("Male"))
                lstSexType.Add(New SexType("Female"))
    
                With Me.ddlSexType
                    .DataSource = lstSexType
                    .DataValueField = "SexTypeT"
                    .DataTextField = "SexTypeT"
                    .DataBind()
                End With
    
                CitizenBind("ALL")
    
            End If
    
        End Sub
    
        Protected Sub ddlSexType_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddlSexType.SelectedIndexChanged
    
            CitizenBind(Me.ddlSexType.SelectedValue)
    
        End Sub
    
    End Class
    

    If you have any questions about the code please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@@Version 1 Using SQL Server 2008, I am trying to cascade values down a
I'm trying to make a hand detection program by using OpenCV and Haar cascade.
I'm trying to return a Custom type from a PostgreSQL function as follows: DROP
I'm trying to bulk-update entities using a StatelessSession. Because it's stateless, NHibernate doesn't auto-cascade
I'm trying to figure out why NHibernate handles one-to-many cascading (using cascade=all-delete-orphan) the way
I'm trying to use ON CASCADE DELETE in mysql db but I can't make
I've been trying to get a delete to cascade and it just doesn't seem
I'm trying to do a cascading save on a large object graph using JPA.
I am trying to map a JPA (using Hibernate) one-to-one relationship with a inheritance
I'm trying to migrate my app from MySql to Postgresql, using Rails3-pre and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.