title: Setting a Custom Attribute on a list item in an HTML Select Control (.NET/C#)
body: <p>I'm trying to create a custom attribute for each list item in a databound HTML Select control.</p>
  
  <p>The resulting HTML output should look something like this:</p>
  
  <pre><code>&lt;select&gt;
  &lt;option value="1" data-value="myValue1"&gt;item&lt;/option&gt;
  &lt;option value="2" data-value="myValue2"&gt;item&lt;/option&gt;
  &lt;option value="3" data-value="myValue3"&gt;item&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I've tried adding attributes like this, but they aren't being rendered:</p>
  
  <pre><code>&lt;select id="selectList" class="multiselect" multiple="true" name="selectList[]" runat="server"&gt;&lt;/select&gt;
  </code></pre>
  
  <p><br></p>
  
  <pre><code>ListItemCollection values = new ListItemCollection();
  
  ListItem test = new ListItem("add");
  test.Attributes.Add("data-value", "myValue");
  
  values.Add(test);
  
  this.selectList.DataSource = values;
  this.selectList.DataBind();
  </code></pre>
  
  <p>Any thoughts on how this can be achieved? Thanks!</p>