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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:55:38+00:00 2026-06-13T09:55:38+00:00

I have two dropdownlists inside an ASP.Net AJAX Update Panel. One dropdownlist populates the

  • 0

I have two dropdownlists inside an ASP.Net AJAX Update Panel. One dropdownlist populates the second through a postback when a user selects a value from the first, and this all works well. However, the problem I have is that I am unable to grab the selectedvalue from the second dropdownlist, by this I mean it always selects the first item rather than the actual selected value.

I have looked at moving the populating the second dropdownlist to If Not IsPostBack Then on the page load, but this then stops the populating of that dropdownlist when the AJAX Update Panel does a partial postback.

So, there is away out of this?

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-06-13T09:55:39+00:00Added an answer on June 13, 2026 at 9:55 am

    If you are changing the value of the second dropdown based on the value selected on the first, you should use the SelectedIndexChanged event of the first dropdown to set the value.

    Your code (from comments):

    On Page_Load I have the following

    If (IsPostBack)
    { 
        ddlSite.Datasource = GetSites();
        ddlSite.Databind();
        ddlPlant.DataSource() = GetPlant(ddlSite.SelectedValue);
        ddlPlant.Databind();
    }
    

    On page load the ddlSite.SelectedValue is always zero.

    You need to bind the second drop down in the ddlSite_SelectedIndexChanged event.

    Page Lifecycle question answered

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

Sidebar

Related Questions

I have two ASP.NET dropdownlists on my web page.The second one is disabled by
I'm building an asp.net cutom control inside which I have two dropdownlists: companyIdSelection and
I am using Asp.net dropdownlist in one of my form ..I have two dropdown
I have two dropdownlist which shows places in my asp.net MVC(C#) application. The First
In my ASP.NET project. I have two dropdownlist and a checkbox. When the checkbox
I have two dropdownlists ,selecting the first dropdown causes postback and second dropdown gets
this problem is driving me really mad. In an Asp.Net-application, I have two DropDownLists,
I have two DropDownLists one for the type of a soldier and one for
I have two DropDownList <asp:DropDownList ID=ddl1 runat=server Width=173px CssClass=ddl > </asp:DropDownList> <asp:DropDownList ID=ddl2 runat=server
I have a dropdownlist that has the value of two columns in it... One

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.