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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:57:46+00:00 2026-05-25T05:57:46+00:00

I am dynamically creating several dropdown list on the selection changed event of a

  • 0

I am dynamically creating several dropdown list on the selection changed event of a main (static) dropdown list. These are created in The TableCell of default Table. When submit button is clicked I need to load a new page with selected values of dropdown as parameters. Basically I need to get the dropdown results in the second page.

This is how dropboxes are created:

    while (reader.Read())
    { 
        pcID = int.Parse(reader["fk_pcID"].ToString());
        pcDesc = GetpcDescription(pcID);
        List<Product> prodList = GetProductsBypcID(pcID);
        DropDownList ddList = new DropDownList();
        ddList.ID = "ddlPC" + pcID;
        foreach(Product prod in prodList)
        {
            ddList.Items.Add(new ListItem(prod.ProductName, prod.ProductID.ToString()));
        }
        TableCell cell1 = new TableCell();
        cell1.Text = pcDesc;

        TableCell cell2 = new TableCell();
        cell2.Controls.Add(ddList);

        TableRow row = new TableRow();
        row.Cells.Add(cell1);
        row.Cells.Add(cell2);

        table.Rows.Add(row);  
    }

EDIT: The above code runs at the selection changed event of a dropdown which is set to runat server. But dynamically created dropdowns are not set to run at server

  • 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-25T05:57:46+00:00Added an answer on May 25, 2026 at 5:57 am

    Are these drop-down boxes runat="server"? Meaning: did you created them programmaticly via a .net post-back event through the code behind? If so, just get the selected value the same as you would with any other control, and then pass it through a query string or a cookie.

    Are these standard html drop-down lists? Good luck reading them from a code-behind. That gets you all tangled up in the viewstate, and while technically possible, is realistically not feasible.

    If the second option is the case, it might be a much better option to have your button target a JavaScript function that gets the selected values and then passes them via querystring. Then on the other page you can read the querystrings from the code-behind, or on the client-side.

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

Sidebar

Related Questions

I am creating several image dynamically using the following code: function refresh_gallery(galleryidentifier, albumid) {
Using DTS I'm dynamically creating an access database. After the file is created (which
I am dynamically creating a table which I want to have clickable rows. When
I am having a JSP page, where i am dynamically creating a Table data.
I have a selection list that is generated dynamically, it lists a number of
I am dynamically creating a table that contains a textbox in each cell. The
I am creating a gridview dynamically with a ButtonField and several BoundFields. ButtonField button
I am dynamically creating a table with data and check boxes in it, my
I have a several form elements that I am dynamically creating with javascript when
I am dynamically creating an HTML table by using a repeater. I have four

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.