Q:

Adding multiple DropDownLists with a button click

Using a combination of ASP.NET (with C#) and jQuery, I'm try to create DropDownLists with a button.  These DropDownLists will be populated with a SQL query.  
The part I'm having difficulty with is adding more than one using just the button click.  
If the user clicks the button 5 times, 5 more DropDownLists should be created and populated with the same data.  Ideally, each DropDownList is contained in a new row of a table, or organized in a similar fashion.  
I do not want to do any SQL connections in JavaScript.  Any advice with this?
Edit:
I've tried using an <asp:PlaceHolder>, and then using that to add a DropDownList.  I could not figure out how to use this method and add more than one, though.:
<asp:PlaceHolder ID="PlaceHolder1" runat="server"/>

protected void Add_Dropdownlist()
{
   DropDownList DropDownList1 = new DropDownList();
   PlaceHolder1.Controls.Add(DropDownList1);
}

I've tried using jQuery to copy the original DropDownList.  The problem I had, was that I couldn't figure out how to get the the original DropDownList from jQuery if it was an <asp:DropDownList>.  If I changed it to a <select> instead, I could not figure out how to populate it with SQL data from the ASP (server) side.
<select id="DropDownList1">
  <option value="-1"></option>
</select>

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

function copy_Dropdownlist()
{
  newDropdownlist = jQuey.extend({}, DropDownList2);
}

In short, I've gone down several paths, but I don't think any of them are right.  I'm new to ASP.NET (google education) and I think the problems lies in linking the client side jQuery and the server side ASP.NET.  Thanks for the help.

A:

(This is in reference to your <asp:PlaceHolder> approach.  I'm actually going to use an <asp:Panel>, as it seems more appropriate here)
It looks like the problem you're running into is that the DropDownLists are not persisted across postbacks.  So, each time you create a new one and add it to your PlaceHolder, you still only end up with one.
To resolve this, you need to keep track of the ones you've already created.  In your Page_Load, you want to create a storage container for your DropDownLists (I use a List<> for this) and save it in the user's "Session".  Notice the !Page.IsPostBack; you only want to create this once (the first time the page loads, not each time you PostBack):
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        List<DropDownList> DDLList = new List<DropDownList>();
        Session["DDLs"] = DDLList;
    }
}

Now when you click the button, you can 

Get the currently existing DropDownLists (if any) from your Session variable,
Add the new one for this button click to that list
Add all of your DropDownLists to the Panel, 
And save the updated list back to your Session variable.

Like this:
protected void Button1_Click(object sender, EventArgs e)
{
    DropDownList newDropDown = new DropDownList();
    List<DropDownList> existingDropDowns = (List<DropDownList>)Session["DDLs"];
    existingDropDowns.Add(newDropDown);

    foreach (DropDownList dropdown in existingDropDowns)
    {
        Panel1.Controls.Add(dropdown);
    }

    Session["DDLs"] = existingDropDowns;
}

I don't know exactly what you're trying to accomplish, but this should hopefully get you started.

