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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:45:06+00:00 2026-06-03T08:45:06+00:00

How to make a dynamic dropdownlist on asp.net? I have a dropdownlist : <asp:DropDownList

  • 0

How to make a dynamic dropdownlist on asp.net?

I have a dropdownlist:

<asp:DropDownList ID="FirstParameter" runat="server">
    <asp:ListItem Value="1">1</asp:ListItem>
    <asp:ListItem Value="2">2</asp:ListItem>
    <asp:ListItem Value="3">3</asp:ListItem>
</asp:DropDownList>  

A label and the other dropdownlist:

<asp:Label ID="SecondParameter_Label" runat="server" Text=""></asp:Label>

<asp:DropDownList ID="SecondParameter" runat="server">
</asp:DropDownList> 

When I change the selection on the FirstParameter dropdownlist, then the text on SecondParameter_Label should change based on the selection, and so for the SecondParameter dropdownlist, should be binding with the data filter based on the selected value on the first dropdownlist.

I have tried this code but it doesn’t work:

Protected Sub FirstParameter_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles FirstParameter.SelectedIndexChanged
    'Change the label text
    SecondParameter_Label.Text = ReportType_Dropdownlist.SelectedItem.Value

    'Bind value to the SecondParameter dropdownlist
    SecondParameter.DataSource = dataTableName '--> Assumed that I already have the DataTable called from a class
    SecondParameter.DataTextField = "NameofDatabaseColumn"
    SecondParameter.DataValueField = "NameofDatabaseColumn"
    SecondParameter.DataBind()
End Sub

I have tried to change the SecondParameter_Label text first but still doesn’t work. How can I do that?

  • 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-03T08:45:08+00:00Added an answer on June 3, 2026 at 8:45 am

    Try adding AutoPostBack property to the dropdowns. You will also need to handle them on the server side. Your first dropdown should like this:

    <asp:DropDownList ID="FirstParameter" runat="server" AutoPostBack="true">
        <asp:ListItem Value="1">1</asp:ListItem>
        <asp:ListItem Value="2">2</asp:ListItem>
        <asp:ListItem Value="3">3</asp:ListItem>
    </asp:DropDownList>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make dynamic hashes, so the class example won't work since the
Hi I need to make an dynamic array like this: I have a max
Using this wiki I have a dynamic dropdownlist working just fine. Instead of the
i have an xml file. how to make dynamic xml? <?xml version=1.0 encoding=ISO-8859-1?> <jukebox>
I have few dynamic dropdowns that the created on change of a dropdownlist, on
I need to make a dynamic menu in java swing. I have a database
I'm trying to make dynamic text scroll on the page. I want it to
I am using ASP.NET Dynamic Data Entities project to generate a web application for
Today I try to make a dynamic dropdownlist using jQuery. I only provide one
I have the following javascript which I need to make dynamic. data.addRows(2); data.setValue(0, 0,

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.