title: How to use the same name in input checkbox when we use asp:CheckBoxList
body: <p>I usually avoid asp: controls and always use pure html controls with <code>runat="server"</code> due to their inflexibility. However, we have a system where it was built using those asp:controls. I have no choice but to follow the way it was built.</p>
  
  <p>Here is the problem, when I data bind <code>asp:CheckBoxList</code> control <code>DataTextField="Name"</code> and <code>DataValueField="ID"</code>, each input checkbox are using different names and when I need selected checkbox IDs, I have to loop through the whole <code>checkboxlist</code> to read the selected values.</p>
  
  <p>If we use all those <code>input name="Types"</code> and read <code>Request.Form["Types"]</code> we can get all the selected ID values separated by commas, ",". In this way, I can avoid looping through all items in that <code>checkboxlist</code>. Is there any way we can do so that those <code>input checkbox</code> to use the same name?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I tried this and it is not working</p>
  
  <pre><code>ChkPropertyFeatures.Attributes.Add("name", "Types")
  </code></pre>
  
  <p>The reason I want to use the same name is not just to avoid loop at backend. I need to use jquery to select all those checkboxes by their name attribute. Yes, I know I can select by class name but I was wondering if I could change the name attribute of those checkboxes generated by Checkboxlist control.</p>