title: How can I add a custom property to a RadioButtonList items?
body: <p>How can I add a bound <a href="http://ejohn.org/blog/html-5-data-attributes/" rel="noreferrer">Html5 data- attribute</a> to the items generated with a bound <code>RadioButtonList</code>?</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>&lt;asp:Repeater Id="QuestionList" ...&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:RadioButtonList DataSource='&lt;%# Eval("Answers") %&gt;'
                           SelectedValue='&lt;%# Eval("SelectedAnswerId") %&gt;'
                           DataTextField="Answer" 
                           DataValueField="AnswerId"
                           Tag='&lt;%# Eval("QuestionId") %&gt;' /&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>var List&lt;Question&gt; questions = GetQuestions();
  QuestionList.DataSource = questions;
  QuestionList.DataBind();
  </code></pre>
  
  <p>It is bound to a class structure that looks like this:</p>
  
  <pre><code>public class Question
  {
      int QuestionId;
      string Question;
      List&lt;Answer&gt; Answers;
  }
  
  public class Answers
  {
      int AnswerId;
      string Answer;
      bool SomeFlag;
  }
  </code></pre>
  
  <p>I need to add <code>SomeFlag</code> to the UI for jQuery to use, so the end result is that each item generated should look like this:</p>
  
  <pre><code>&lt;input type="radio" data-flag="true" ... /&gt;
  </code></pre>
  
  <p>Is there a way to add a html data- attribute to the input objects generated from a bound <code>RadioButtonList</code>?</p>