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

  • SEARCH
  • Home
  • 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 3404050
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:20:07+00:00 2026-05-18T05:20:07+00:00

I have two dropdownlist’s.DropDownList2(not bound to a datasource) and DropDownList3(bound to a datasource) On

  • 0

I have two dropdownlist’s.DropDownList2(not bound to a datasource) and DropDownList3(bound to a datasource)

On change on input in one dropdownlist some content in the other Dropdownlist should change. For that i had used the logic as.

Autopostback is enabled for both this controls.

   protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList2.SelectedItem.Text == "Stamp")
        {
            DropDownList3.Items.Remove(DropDownList3.Items.FindByText("STA"));
            DropDownList3.Items.Remove(DropDownList3.Items.FindByText("STM"));
        }


<asp:DropDownList ID="DropDownList3" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="skey" DataValueField="casecode" 
            AppendDataBoundItems="True" AutoPostBack="True">
            <asp:ListItem Selected="True" Value="S">Select</asp:ListItem>
        </asp:DropDownList>

Now the problem is when i select DropDownList2.SelectedItem.Text == "Reg" STA and STM are not present. I want STA and STM values back in the dropdownlist on selection of ‘Reg’.

When i first load my page and select ‘Reg’ all the values in DropDownList3(including ‘STA’ and ‘STM’) are present and than when i select ‘Stamp’ the values ‘STA’ and ‘STM’ are lost(as shown in the code). Now again when i select ‘Reg’ this values are not there, i want this values to be present again.

What do i have to do?? Do i have to bind it again to database?

Is there any other logic for it to be used in a different way ?If anyone can help me

  • 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-05-18T05:20:07+00:00Added an answer on May 18, 2026 at 5:20 am

    If you know the values of the dropdown items, you can add them in the else clause, if you don’t know the value/text combination you’ll have to rebind.

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

Sidebar

Related Questions

I have two dropdown lists (one dynamically populated, the other not) that determine the
I have two dropdownlist. The selected value from the first one loads the other.
I have a Gridview in which i have two templatefields of dropdownlist. I bound
I have two dropdownlist in one view but i don't know if i can
I have two problems that I'm not sure are related: I have two DropDownList
I have two dropdownlist, one is State and one is City. When a State
I have two dropdownlists and I am filling one based on the other using
I am using Asp.net dropdownlist in one of my form ..I have two dropdown
i have two select using as a dropdownlist for country/state everything works as i
I have two applications written in Java that communicate with each other using XML

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.