title: How to populate dynamically added html select controls from code behind?
body: <p>I've been programming in asp.net and c# for a week or so, please bear with me.</p>
  
  <p>I'm trying to do a receipt generator in asp c# that looks kinda like this:</p>
  
  <p><img src="https://i73.photobucket.com/albums/i214/Nightcrawler91/Sintiacutetulo.png" alt="Receipt"></p>
  
  <p>the blue button adds a new row to the table with this javascript function:</p>
  
  <pre><code>function nuevo(){
  $("#tablaUsuarios").append("&lt;tr&gt;" +
      "&lt;td&gt;&lt;select name='listaConceptos' id='listaConceptos' runat='server'&gt;&lt;/select&gt;&lt;/td&gt;" +
      "&lt;td&gt;&lt;input name='precio' id='precio' type='text' size='15' runat='server' readonly/&gt;&lt;/td&gt;" +
      "&lt;td&gt;&lt;input type='button' value='Eliminar' onclick='eliminar(this)' class='btn btn-danger eliminar'&gt;&lt;/td&gt;"+
      "&lt;/tr&gt;")
  }
  </code></pre>
  
  <p>However since I'm adding the controls via javascript on runtime, I have no access to them from the code behind like I would if they were DropDownList controls, adding <strong><em>runat="server"</em></strong> is also useless since at runtime I can't turn them into server controls, is there any way to access the control so I can populate, set data sources, etc. as if it were a DropDownList? Or any other way to dynamically generate and populate DDL?</p>
  
  <p>I thought about having a hidden DropDownList populated with all the data I need from my database, and copying all its properties to the other select controls upon creation but I don't know if it would behave like a DDL with its DataValueFields and TextFields.</p>