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 5942713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:17:33+00:00 2026-05-22T16:17:33+00:00

I have a Dropdownlist (DDL1) when I select any item from this dropdownlist(DDL1), results

  • 0

I have a Dropdownlist (DDL1) when I select any item from this dropdownlist(DDL1), results in creation of another dropdownlist(DDL2), This contains some of the items.When I select other Item from DDL1 , Items will change in DDL2, this happens for the each different item selected in DDL1.

when I select a item from DDL2, label content must be shown, intially I’m making Label invisibe and in the code I changed the visibility to true and added content to it. But the label content is not shown when I select a item from DDL2.

Here is my Code

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
     if (DropDownList1.SelectedValue == "Abe Books")
    {
        DropDownSeller.Visible = true;
        lnkUsdBooks.Visible = true;
        lnkUsdBooks.Text = "usedbooks@abe.com";
        lnkUsdBooks.NavigateUrl = "mailto:usedbook@abe.com";
        DropDownSeller.Visible = true;
        DropDownSeller.Items.Remove("Chacha Choudary");
        DropDownSeller.Items.Remove("SpiderMan");
        DropDownSeller.Items.Remove("Amar chitra Katha");
        DropDownSeller.Items.Remove("Chandamama");
        DropDownSeller.Items.Remove("Mahabharata");
        DropDownSeller.Items.Add("Amar chitra Katha");
        DropDownSeller.Items.Add("Chandamama");
        DropDownSeller.Items.Add("Mahabharata");
        DropDownSeller.DataBind();

            if (DropDownSeller.SelectedValue == "Amar chitra Katha")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$69.99";
            }
            else if (DropDownSeller.SelectedValue == "Chandamama")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$59.99";
            }
            else if (DropDownSeller.SelectedValue == "Mahabharata")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$49.99";
            }
            else
            {
                lblPrice.Visible = false;
            }
        }

Any ideas on this are appreciated

Thanks,

  • 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-22T16:17:33+00:00Added an answer on May 22, 2026 at 4:17 pm

    Remove if (!Page.IsPostBack) from the DropDownList1_SelectedIndexChanged because when the page postbacks this condition will be false. Because your page is posting back to the server that’s why it is not visible and not showing.

    In short your DropDownList1_SelectedIndexChanged should be like..

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedValue == "Abe Books")
        {
            DropDownSeller.Visible = true;
            lnkUsdBooks.Visible = true;
            lnkUsdBooks.Text = "usedbooks@abe.com";
            lnkUsdBooks.NavigateUrl = "mailto:usedbook@abe.com";
            DropDownSeller.Visible = true;
    
            DropDownSeller.Items.Clear(); // it will clear all the items, instead you are removing one by one
    
            DropDownSeller.Items.Add("Amar chitra Katha");
            DropDownSeller.Items.Add("Chandamama");
            DropDownSeller.Items.Add("Mahabharata");
            DropDownSeller.DataBind(); 
        }
        protected void DropDownSeller_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DropDownSeller.SelectedValue == "Amar chitra Katha")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$69.99";
            }
            else if (DropDownSeller.SelectedValue == "Chandamama")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$59.99";
            }
            else if (DropDownSeller.SelectedValue == "Mahabharata")
            {
                lblPrice.Visible = true;
                lblPrice.Text = "$49.99";
            }
            else
            {
                lblPrice.Visible = false;
            } 
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dropdownlist with 5 items. Value of last item is other. By
I have DropDownList, which has some options to choose from. Now after when user
I have a Dropdownlist or maybe better described as a select control. This list
I want to have dropdownlist with months and years from some point in the
I have DropDownList with CascadingDropDown extender. If I want to retrieve data from the
I have a DropDownList that contains Station codes. @Html.DropDownList(Station, null, new { id =
I have a Dropdownlist <select name=cate> <option value=h>India</option> <option value=m>USA</option> <option value=c>England</option> </select> <input
I have a dropdownlist in gridview and bind grid view from a function in
i have dropdownlist with the values: <select id=myddl name=myddl> <option value=1>One</option> <option value=2>Twooo</option> <option
I have a dropdownlist with following options: <asp:DropDownList ID=ddlTaxStatus runat=server OnPreRender=ddlContainerStatus_PreRender> <asp:ListItem Text=--Select-- Value=-1></asp:ListItem>

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.